Skip to content

Commit

Permalink
fix(Core/Spells): Restore sending SMSG_CAST_FAILED for spells in SPEL… (
Browse files Browse the repository at this point in the history
azerothcore#19102)

* 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 <shauren.trinity@gmail.com>

* ocd

* correct animation and castbar staying

---------

Co-authored-by: Shauren <shauren.trinity@gmail.com>
  • Loading branch information
avarishd and Shauren authored Jul 17, 2024
1 parent cf7c015 commit ade4c25
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/server/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3712,25 +3712,23 @@ void Spell::cancel(bool bySelf)
return;

uint32 oldState = m_spellState;
bool autoRepeat = m_autoRepeat;
m_spellState = SPELL_STATE_FINISHED;

m_autoRepeat = false;
switch (oldState)
{
case SPELL_STATE_PREPARING:
CancelGlobalCooldown();
SendCastResult(SPELL_FAILED_INTERRUPTED);

if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
if (m_caster->ToPlayer()->NeedSendSpectatorData())
ArenaSpectator::SendCommand_Spell(m_caster->FindMap(), m_caster->GetGUID(), "SPE", m_spellInfo->Id, bySelf ? 99998 : 99999);
}
[[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)
Expand Down

0 comments on commit ade4c25

Please sign in to comment.