aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectAccessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r--src/game/ObjectAccessor.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp
index 70a1bada3f9..b420e4af4b2 100644
--- a/src/game/ObjectAccessor.cpp
+++ b/src/game/ObjectAccessor.cpp
@@ -51,11 +51,14 @@ ObjectAccessor::~ObjectAccessor() {}
Creature*
ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid)
{
- if(Creature *unit = GetPet(guid))
- return unit;
+ if(IS_PLAYER_GUID(guid))
+ return NULL;
+
+ if(IS_PET_GUID(guid))
+ return GetPet(guid);
- if(Creature *unit = GetVehicle(guid))
- return unit;
+ if(IS_VEHICLE_GUID(guid))
+ return GetVehicle(guid);
return u.GetMap()->GetCreature(guid);
}