diff options
-rw-r--r-- | src/game/Unit.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ade913d8c26..264b81bd0cd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -46,6 +46,7 @@ #include "GridNotifiersImpl.h" #include "CellImpl.h" #include "Path.h" +#include "TemporarySummon.h" #include <math.h> @@ -3424,6 +3425,23 @@ void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id) m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); m_currentSpells[CURRENT_CHANNELED_SPELL]->SetReferencedFromCurrent(false); m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; + + // Unsummon any summoned as possessed creatures on channel interrupt + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); + if (!spellInfo || !interrupted) + return; + for (int i = 0; i < 3; i++) + { + if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON && + (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED || + spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 || + spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) + { + // Possession is removed in the UnSummon function + if (GetCharm()) + ((TemporarySummon*)GetCharm())->UnSummon(); + } + } } } |