diff options
author | megamage <none@none> | 2009-08-25 11:42:18 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-25 11:42:18 -0500 |
commit | 8cedad1a0f1e8f58b1b0ff1195fed790e66b6408 (patch) | |
tree | 7e6dd781a51a9a47fc71db289a5ba0c0ff9706d1 /src/game/Object.h | |
parent | ba78dd144114806d28a8d9615bc7c84623a26989 (diff) |
*Do not make getmapid virtual function to improve speed.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.h')
-rw-r--r-- | src/game/Object.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/game/Object.h b/src/game/Object.h index 3688f37c882..3b568ef225f 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -439,8 +439,8 @@ class TRINITY_DLL_SPEC WorldObject : public Object void GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z ) const; - virtual uint32 GetMapId() const { return m_currMap ? m_currMap->GetId() : 0; } - virtual uint32 GetInstanceId() const { return m_currMap ? m_currMap->GetInstanceId() : 0; } + uint32 GetMapId() const { return m_mapId; } + uint32 GetInstanceId() const { return m_InstanceId; } virtual void SetPhaseMask(uint32 newPhaseMask, bool update); uint32 GetPhaseMask() const { return m_phaseMask; } @@ -578,8 +578,17 @@ class TRINITY_DLL_SPEC WorldObject : public Object bool m_isActive; ZoneScript *m_zoneScript; + //these functions are used mostly for Relocate() and Corpse/Player specific stuff... + //use them ONLY in LoadFromDB()/Create() funcs and nowhere else! + //mapId/instanceId should be set in SetMap() function! + void SetLocationMapId(uint32 _mapId) { m_mapId = _mapId; } + void SetLocationInstanceId(uint32 _instanceId) { m_InstanceId = _instanceId; } + private: Map * m_currMap; //current object's Map location + + uint32 m_mapId; // object at map with map_id + uint32 m_InstanceId; // in map copy with instance id uint32 m_phaseMask; // in area phase state float m_positionX; |