diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.h | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5ec5cbc1c19..e3e98805ceb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -473,7 +473,7 @@ Player::~Player () for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) itr->second.save->RemovePlayer(this); - if (isPossessing()) + if (m_uint32Values && isPossessing()) RemovePossess(false); delete m_declinedname; diff --git a/src/game/Unit.h b/src/game/Unit.h index 0e3294c0c67..8771cff0688 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1084,7 +1084,13 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool isCharmed() const { return GetCharmerGUID() != 0; } bool isPossessed() const { return m_isPossessed; } bool isPossessedByPlayer() const { return m_isPossessed && IS_PLAYER_GUID(GetCharmerGUID()); } - bool isPossessing() const { return GetCharm() && GetCharm()->isPossessed(); } + bool isPossessing() const + { + if(Unit *u = GetCharm()) + return u->isPossessed(); + else + return false; + } bool isPossessing(Unit* u) const { return u->isPossessed() && GetCharmGUID() == u->GetGUID(); } bool isPossessingCreature() const { return isPossessing() && IS_CREATURE_GUID(GetCharmGUID()); } |