aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Totem.cpp12
-rw-r--r--src/game/Unit.cpp14
2 files changed, 14 insertions, 12 deletions
diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index 0368abe1eef..282dc7678cb 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -112,18 +112,6 @@ void Totem::UnSummon()
CombatStop();
RemoveAurasDueToSpell(GetSpell());
- // 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)
{
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b4a1efa9c45..0e0416e5b01 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9039,8 +9039,22 @@ void Unit::SetMinion(Minion *minion, bool apply)
m_Controlled.erase(minion);
if (minion->IsGuardianPet())
+ {
if (GetPetGUID() == minion->GetGUID())
SetPetGUID(0);
+ }
+ else if (minion->isTotem())
+ {
+ // All summoned by totem minions must disappear when it is removed.
+ if (const SpellEntry* spInfo = sSpellStore.LookupEntry(((Totem*)minion)->GetSpell()))
+ for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (spInfo->Effect[i] != SPELL_EFFECT_SUMMON)
+ continue;
+
+ this->RemoveAllMinionsByEntry(spInfo->EffectMiscValue[i]);
+ }
+ }
if (GetTypeId() == TYPEID_PLAYER)
{