aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Creature
diff options
context:
space:
mode:
authordr.skull <dr.skull@centrum.sk>2012-08-23 17:59:24 +0200
committerdr.skull <dr.skull@centrum.sk>2012-08-23 18:01:59 +0200
commit105a0da3505fb714fbfc9e2b26baa8102364b56a (patch)
tree25d3277e2dbdcba421a1da6cdc00be2cc386f54e /src/server/game/Entities/Creature
parent58c9d7188fa7ef8064b32c207a9726e33ce79e92 (diff)
Remove Sentry Totem Aura when Sentry Totem is destroyed.
For Totems use Totem::UnSummon() when old totem is replaced with new one Signed-off-by: dr.skull <dr.skull@centrum.sk>
Diffstat (limited to 'src/server/game/Entities/Creature')
-rwxr-xr-xsrc/server/game/Entities/Creature/TemporarySummon.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 43b29c600d6..ff39a482187 100755
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -21,6 +21,7 @@
#include "CreatureAI.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
+#include "Totem.h"
TempSummon::TempSummon(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) :
Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
@@ -195,7 +196,12 @@ void TempSummon::InitStats(uint32 duration)
{
Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
if (oldSummon && oldSummon->isSummon())
- oldSummon->ToTempSummon()->UnSummon();
+ {
+ if (oldSummon->isTotem())
+ oldSummon->ToTotem()->UnSummon();
+ else
+ oldSummon->ToTempSummon()->UnSummon();
+ }
}
owner->m_SummonSlot[slot] = GetGUID();
}