aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 59d019800ed..9f2a0cd33e0 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -48,6 +48,7 @@
#include "VMapFactory.h"
#include "BattleGround.h"
#include "Util.h"
+#include "TemporarySummon.h"
#define SPELL_CHANNEL_UPDATE_INTERVAL 1000
@@ -2187,6 +2188,20 @@ void Spell::cancel()
} break;
}
+ // Unsummon summon as possessed creatures on spell cancel
+ for (int i = 0; i < 3; i++)
+ {
+ 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))
+ {
+ // 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);