aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-20 12:05:58 -0600
committermegamage <none@none>2009-02-20 12:05:58 -0600
commit1b587c0fe3355567173918d7a0b56141c6bcd1b2 (patch)
treefd8b03d40861ec08c1fd3d47744131032f7398bd /src/game/Spell.cpp
parent187cd928ea6a02df715c349ec970d5899ef6274f (diff)
parent956c828bf56f06b5c25ff20d760ad41be2642a51 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 3556888aa1e..b5046a18491 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2109,21 +2109,27 @@ void Spell::cancel()
} break;
}
+ finish(false);
+
// Unsummon summon as possessed creatures on spell cancel
- for (int i = 0; i < 3; i++)
+ if(m_caster->GetTypeId() == TYPEID_PLAYER)
{
- if (m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&
- (m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||
- m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||
- m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3))
+ for(int i = 0; i < 3; ++i)
{
- // Possession is removed in the UnSummon function
- if (m_caster->GetCharm())
- ((TemporarySummon*)m_caster->GetCharm())->UnSummon();
+ if(m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&
+ (m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||
+ m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||
+ m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3))
+ {
+ ((Player*)m_caster)->StopCastingCharm();
+ break;
+ // Possession is removed in the UnSummon function
+ //if (m_caster->GetCharm())
+ // ((TemporarySummon*)m_caster->GetCharm())->UnSummon();
+ }
}
}
- finish(false);
m_caster->RemoveDynObject(m_spellInfo->Id);
m_caster->RemoveGameObject(m_spellInfo->Id,true);
}