aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-07 17:17:01 -0600
committermegamage <none@none>2009-03-07 17:17:01 -0600
commit658568a8e2eb749ea974b45e09b7e2775d6e0c69 (patch)
tree2cd0e5968e57e3d1def7c8f7391668c25febf58a /src/game/Spell.cpp
parent6dc06ab53b2e5307b682c5723b3c6fd62318633e (diff)
*Fix a crash when statues are killed.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 707f1819968..442df24239a 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2116,8 +2116,11 @@ void Spell::cancel()
if(m_spellState == SPELL_STATE_FINISHED)
return;
+ uint32 oldState = m_spellState;
+ m_spellState = SPELL_STATE_FINISHED;
+
m_autoRepeat = false;
- switch (m_spellState)
+ switch (oldState)
{
case SPELL_STATE_PREPARING:
case SPELL_STATE_DELAYED:
@@ -2149,10 +2152,13 @@ void Spell::cancel()
} break;
}
- finish(false);
-
m_caster->RemoveDynObject(m_spellInfo->Id);
m_caster->RemoveGameObject(m_spellInfo->Id,true);
+
+ //set state back so finish will be processed
+ m_spellState = oldState;
+
+ finish(false);
}
void Spell::cast(bool skipCheck)