diff options
author | gvcoman <none@none> | 2008-11-18 15:52:52 -0500 |
---|---|---|
committer | gvcoman <none@none> | 2008-11-18 15:52:52 -0500 |
commit | df6a8e5f8e11e914843db0dc9c41f3a415587cfd (patch) | |
tree | 2112159202fa5f9fe504bcc807759d1804e58733 | |
parent | 53de62cee0fb2923459241b46eaea2ab2051d974 (diff) |
Unsummon summon as possessed creatures on spell channeling interrupt.
--HG--
branch : trunk
-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(); + } + } } } |