mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
fix(Core/TotemAI): Active totems should interrupt its spell casting i… (#12864)
...f current victim is dead.
This commit is contained in:
@@ -60,8 +60,23 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
|||||||
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
|
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!me->IsAlive() || me->IsNonMeleeSpellCast(false))
|
if (!me->IsAlive())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me->IsNonMeleeSpellCast(false))
|
||||||
|
{
|
||||||
|
if (Unit* victim = ObjectAccessor::GetUnit(*me, i_victimGuid))
|
||||||
|
{
|
||||||
|
if (!victim || !victim->IsAlive())
|
||||||
|
{
|
||||||
|
me->InterruptNonMeleeSpells(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Search spell
|
// Search spell
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->ToTotem()->GetSpell());
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->ToTotem()->GetSpell());
|
||||||
|
|||||||
Reference in New Issue
Block a user