aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 14 insertions, 0 deletions
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)
{