From e00106db5511f8a428c7b40df7e5f310bcefda16 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 5 Apr 2009 17:31:12 -0500 Subject: [PATCH] *Always delink spell and container when spell is cancelled. --HG-- branch : trunk --- src/game/Spell.cpp | 4 ++++ src/game/SpellAuras.cpp | 2 -- src/game/SpellHandler.cpp | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 1e9a2a7d60e..e8a5724dfb0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2133,6 +2133,10 @@ void Spell::cancel() if(m_spellState == SPELL_STATE_FINISHED) return; + SetReferencedFromCurrent(false); + if(m_selfContainer) + *m_selfContainer = NULL; + uint32 oldState = m_spellState; m_spellState = SPELL_STATE_FINISHED; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 15275417a59..c3af4d70a43 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3234,8 +3234,6 @@ void Aura::HandleAuraModSilence(bool apply, bool Real) if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING ) { currentSpell->cancel(); - currentSpell->SetReferencedFromCurrent(false); - m_target->m_currentSpells[i] = NULL; } } } diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index c4bbfe88be4..3da05d37f3d 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -392,8 +392,6 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket) if(spell->m_spellInfo->Id==spellId) { spell->cancel(); - spell->SetReferencedFromCurrent(false); - _player->m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; } } return;