From 2cf95ca6cbba43139684b3f5ec18c1cf71166f52 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Tue, 18 Jun 2024 03:26:18 +0300 Subject: [PATCH] =?UTF-8?q?fix(Core/Spells):=20Don't=20send=20SMSG=5FCAST?= =?UTF-8?q?=5FFAILED=20for=20interrupted=20spells=20=E2=80=A6=20(#19082)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spells): Don't send SMSG_CAST_FAILED for interrupted spells after they were launched or channelling was started (this clears cooldown on client) https: //github.com/TrinityCore/TrinityCore/commit/63bc405faeb7afcf99de6f7531e4ea59065165f4 Co-authored-by: Shauren --- src/server/game/Spells/Spell.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5263c701b..f49653242 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3710,7 +3710,6 @@ void Spell::cancel(bool bySelf) return; uint32 oldState = m_spellState; - bool autoRepeat = m_autoRepeat; m_spellState = SPELL_STATE_FINISHED; m_autoRepeat = false; @@ -3723,12 +3722,9 @@ void Spell::cancel(bool bySelf) if (m_caster->ToPlayer()->NeedSendSpectatorData()) ArenaSpectator::SendCommand_Spell(m_caster->FindMap(), m_caster->GetGUID(), "SPE", m_spellInfo->Id, bySelf ? 99998 : 99999); } - [[fallthrough]]; /// @todo: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked. + [[fallthrough]]; case SPELL_STATE_DELAYED: - SendInterrupted(0); - // xinef: fixes bugged gcd reset in some cases - if (!autoRepeat) - SendCastResult(SPELL_FAILED_INTERRUPTED); + SendInterrupted(SPELL_FAILED_INTERRUPTED); break; case SPELL_STATE_CASTING: @@ -3740,8 +3736,7 @@ void Spell::cancel(bool bySelf) unit->RemoveOwnedAura(m_spellInfo->Id, m_originalCasterGUID, 0, AURA_REMOVE_BY_CANCEL); SendChannelUpdate(0); - SendInterrupted(0); - SendCastResult(SPELL_FAILED_INTERRUPTED); + SendInterrupted(SPELL_FAILED_INTERRUPTED); } if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->NeedSendSpectatorData())