aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp14
1 files changed, 7 insertions, 7 deletions
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);