From 6c34d8b5ce67974af438888aba86a6904ad9c8fb Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 2 Oct 2020 19:04:33 +0200 Subject: [PATCH] Core/Spells: relocated SPELL_FINISHED_CHANNELING_COMPLETE handling to a better place --- src/server/game/Spells/Spell.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9b1d2c2e83..58186cb653 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3954,10 +3954,6 @@ void Spell::update(uint32 difftime) { SendChannelUpdate(0); finish(); - - if (Creature* creatureCaster = m_caster->ToCreature()) - if (creatureCaster->IsAIEnabled) - creatureCaster->AI()->OnSpellCastFinished(m_spellInfo, SPELL_FINISHED_CHANNELING_COMPLETE); } break; } @@ -4048,6 +4044,11 @@ void Spell::finish(bool ok, bool sendChannelUpdate /* = false */) // Stop Attack for some spells if (m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET)) m_caster->AttackStop(); + + if (m_spellInfo->IsChanneled()) + if (Creature* creatureCaster = m_caster->ToCreature()) + if (creatureCaster->IsAIEnabled) + creatureCaster->AI()->OnSpellCastFinished(m_spellInfo, SPELL_FINISHED_CHANNELING_COMPLETE); } void Spell::WriteCastResultInfo(WorldPacket& data, Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)