From c153f7f272d574cf72c7c96825db19973655d209 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 10 May 2009 12:41:05 -0500 Subject: *A temp fix for the crash caused by feared statue. I will push a better fix later. Thanks to Drahy. --HG-- branch : trunk --- src/game/Spell.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 5d4dae7f0b5..5b53647fe4c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2856,8 +2856,7 @@ void Spell::finish(bool ok) m_caster->clearUnitState(UNIT_STAT_CASTING); // Unsummon summon as possessed creatures on spell cancel - if(IsChanneledSpell(m_spellInfo) - && m_caster->GetTypeId() == TYPEID_PLAYER) + if(IsChanneledSpell(m_spellInfo) && m_caster->GetTypeId() == TYPEID_PLAYER) { if (Unit * charm = m_caster->GetCharm()) for(int i = 0; i < 3; ++i) @@ -2875,7 +2874,12 @@ void Spell::finish(bool ok) } } } - else if (m_caster->GetTypeId()==TYPEID_UNIT && ((Creature*)m_caster)->isSummon()) + + // other code related only to successfully finished spells + if(!ok) + return; + + if (m_caster->GetTypeId()==TYPEID_UNIT && ((Creature*)m_caster)->isSummon()) { // Unsummon statue uint32 spell = m_caster->GetUInt32Value(UNIT_CREATED_BY_SPELL); @@ -2888,10 +2892,6 @@ void Spell::finish(bool ok) } } - // other code related only to successfully finished spells - if(!ok) - return; - //remove spell mods if (m_caster->GetTypeId() == TYPEID_PLAYER) ((Player*)m_caster)->RemoveSpellMods(this); -- cgit v1.2.3