From 93ae148a7594c8b6d2e81d5907ff025b62d76c52 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 28 Aug 2022 01:17:26 +0200 Subject: [PATCH] =?UTF-8?q?fix(Core/TotemAI):=20Active=20totems=20should?= =?UTF-8?q?=20interrupt=20its=20spell=20casting=20i=E2=80=A6=20(#12864)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...f current victim is dead. --- src/server/game/AI/CoreAI/TotemAI.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index d12232f27..9df6fbb7c 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -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());