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