fix(Core/Unit): add melee spell breaking for spells with cast time (#19376)

melee spells breaking
This commit is contained in:
Jelle Meeus
2024-07-17 12:49:43 +02:00
committed by GitHub
parent a950a7f44e
commit 9f5b01ab37

View File

@@ -3959,6 +3959,16 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
m_AutoRepeatFirstCast = true;
}
// melee spells breaking
if (m_currentSpells[CURRENT_MELEE_SPELL])
{
// break melee spells if cast time
if (pSpell->GetCastTime() > 0)
{
InterruptSpell(CURRENT_MELEE_SPELL);
}
}
if (pSpell->GetCastTime() > 0)
AddUnitState(UNIT_STATE_CASTING);