From ade4c2527fa43b2bdfbe825bf91e177320bb3c6b Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:14:06 +0300 Subject: [PATCH] =?UTF-8?q?fix(Core/Spells):=20Restore=20sending=20SMSG=5F?= =?UTF-8?q?CAST=5FFAILED=20for=20spells=20in=20SPEL=E2=80=A6=20(#19102)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/Spells): Restore sending SMSG_CAST_FAILED for spells in SPELL_STATE_PREPARING state (cast bar in progress) unintentionally removed https: //github.com/TrinityCore/TrinityCore/commit/844efbfca84580f7b2bd700f40209515f2aaa959 Co-Authored-By: Shauren * ocd * correct animation and castbar staying --------- Co-authored-by: Shauren --- src/server/game/Spells/Spell.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index dc6c9c4a5bd16b..bd9506c059d5ef 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3712,7 +3712,6 @@ void Spell::cancel(bool bySelf) return; uint32 oldState = m_spellState; - bool autoRepeat = m_autoRepeat; m_spellState = SPELL_STATE_FINISHED; m_autoRepeat = false; @@ -3720,6 +3719,8 @@ void Spell::cancel(bool bySelf) { case SPELL_STATE_PREPARING: CancelGlobalCooldown(); + SendCastResult(SPELL_FAILED_INTERRUPTED); + if (m_caster->GetTypeId() == TYPEID_PLAYER) { if (m_caster->ToPlayer()->NeedSendSpectatorData()) @@ -3727,10 +3728,7 @@ void Spell::cancel(bool bySelf) } [[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: if (!bySelf)