Core/Unit: fixed Global cooldown cancelation on spell interrupt

This commit is contained in:
ariel- authored and Ovahlord committed 2021-04-16 20:41:20 +02:00
1 parent 974f3163bc
commit 5c882e8788
1 file changed
+5 -4
+5 -4
View File
@@ -3052,15 +3052,16 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
if (GetTypeId() == TYPEID_PLAYER)
ToPlayer()->SendAutoRepeatCancel(this);
m_currentSpells[spellType] = nullptr;
if (spell->getState() != SPELL_STATE_FINISHED)
spell->cancel(interruptingSpell);
else
{
m_currentSpells[spellType] = nullptr;
spell->SetReferencedFromCurrent(false);
}
if (GetTypeId() == TYPEID_UNIT && IsAIEnabled)
ToCreature()->AI()->OnSpellCastFinished(spell->GetSpellInfo(), SPELL_FINISHED_CANCELED);
spell->SetReferencedFromCurrent(false);
}
}