fix(Core/TotemAI): Active totems should interrupt its spell casting i… (#12864)

...f current victim is dead.
This commit is contained in:
UltraNix
2022-08-28 01:17:26 +02:00
committed by GitHub
parent db760ee2ed
commit 93ae148a75

View File

@@ -60,8 +60,23 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
return;
if (!me->IsAlive() || me->IsNonMeleeSpellCast(false))
if (!me->IsAlive())
{
return;
}
if (me->IsNonMeleeSpellCast(false))
{
if (Unit* victim = ObjectAccessor::GetUnit(*me, i_victimGuid))
{
if (!victim || !victim->IsAlive())
{
me->InterruptNonMeleeSpells(false);
}
}
return;
}
// Search spell
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->ToTotem()->GetSpell());