aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-21 17:57:12 -0600
committermegamage <none@none>2009-03-21 17:57:12 -0600
commite01e7d7934dce58c246eb956bf513ef7e3f073c9 (patch)
treecf1bdea26abc6d1362e1d9c8ce355878cf2a6484 /src/game/Unit.cpp
parentecb87676a9021920c4c1aa51c5d06a1221b2a965 (diff)
*Fix a crash caused by possessing pet.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index af26cdbfa2f..023bbf5df5b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -13047,7 +13047,8 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
}
// Pets already have a properly initialized CharmInfo, don't overwrite it.
- if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN))
+ if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT
+ && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN) && !((Creature*)this)->isPet())
{
CharmInfo *charmInfo = InitCharmInfo();
if(possess)
@@ -13168,7 +13169,8 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
}
//a guardian should always have charminfo
- if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN))
+ if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT
+ && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN) && !((Creature*)this)->isPet())
{
DeleteCharmInfo();
}