aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstellar <none@none>2010-01-05 01:46:22 +0300
committerAstellar <none@none>2010-01-05 01:46:22 +0300
commit51d0e0fa8cc47e8d675259ec485fa2b62fa77041 (patch)
treef9fa7698d83d4a678fd27e8ad35d5e70051a7ee8
parent39746981c71fcc49ecc7dc80352441cb45cd8671 (diff)
Fixed Issue 10. Now summoned elemental is correctly despawned.
Try to find a better place for such check... --HG-- branch : trunk
-rw-r--r--src/game/Totem.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index a82f273bdbc..0368abe1eef 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -112,7 +112,19 @@ void Totem::UnSummon()
CombatStop();
RemoveAurasDueToSpell(GetSpell());
- // clear owenr's totem slot
+ // All summoned by totem minions must disappear when it is removed.
+ if (const SpellEntry* spInfo = sSpellStore.LookupEntry(GetSpell()))
+ {
+ for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (spInfo->Effect[i] != SPELL_EFFECT_SUMMON)
+ continue;
+
+ m_owner->RemoveAllMinionsByEntry(spInfo->EffectMiscValue[i]);
+ }
+ }
+
+ // clear owner's totem slot
for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
{
if(m_owner->m_SummonSlot[i]==GetGUID())