aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectAccessor.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-01 18:36:03 -0500
committermegamage <none@none>2009-07-01 18:36:03 -0500
commit4a8a89e1db1f103020ffecbb570e1c570c2e0d21 (patch)
treed5e62fa664a0f36d668f738abc50ac9406d50e5a /src/game/ObjectAccessor.h
parent111dac5f94eac3fe26da2107842dea4e1aacd660 (diff)
[8103] More wide use IsInWorld checks and delayed at teleport operations. Author: Ambal
* IsInWorld used to prevent return unexpected not in world objects. * Delayed operations need to process its in world state. --HG-- branch : trunk
Diffstat (limited to 'src/game/ObjectAccessor.h')
-rw-r--r--src/game/ObjectAccessor.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h
index 80aac0bcf92..fea928a54eb 100644
--- a/src/game/ObjectAccessor.h
+++ b/src/game/ObjectAccessor.h
@@ -103,8 +103,14 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
if(!guid)
return NULL;
- if(IS_PLAYER_GUID(guid))
- return (Unit*)HashMapHolder<Player>::Find(guid);
+ if (IS_PLAYER_GUID(guid))
+ {
+ Unit * u = (Unit*)HashMapHolder<Player>::Find(guid);
+ if(!u || !u->IsInWorld())
+ return NULL;
+
+ return u;
+ }
if(IS_CREATURE_GUID(guid))
return (Unit*)HashMapHolder<Creature>::Find(guid);