From b28ff89c5d729ff0ffad2c85680e8c3660722773 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 3 Sep 2022 13:22:21 +0200 Subject: [PATCH] Core/Spells: Prevent manual cancelling of channelled spells that have SPELL_ATTR0_CANT_CANCEL --- src/server/game/Handlers/SpellHandler.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 52b30a1036..e08c8ec972 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -394,6 +394,12 @@ void WorldSession::HandleCancelChanneling(WorldPacket& recvData) uint32 spellId = 0; recvData >> spellId; // Spell Id + Unit* mover = GetGameClient()->GetActivelyMovedUnit(); + + // ignore for remote control state (for player case) + if (!mover) + return; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) return; @@ -402,10 +408,8 @@ void WorldSession::HandleCancelChanneling(WorldPacket& recvData) if (spellInfo->HasAttribute(SPELL_ATTR0_NO_AURA_CANCEL)) return; - Unit* mover = GetGameClient()->GetActivelyMovedUnit(); - - // ignore for remote control state (for player case) - if (!mover) + Spell* spell = mover->GetCurrentSpell(CURRENT_CHANNELED_SPELL); + if (!spell || spell->GetSpellInfo()->Id != spellInfo->Id) return; mover->InterruptSpell(CURRENT_CHANNELED_SPELL);