diff options
author | megamage <none@none> | 2009-06-16 11:19:59 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-16 11:19:59 -0500 |
commit | 3cf2be604275ec1ae7321b78dc6b62e559a5d7c7 (patch) | |
tree | d119d51bcee396d8fe913fa6b709ff45da2a2c2e /src/game/Object.cpp | |
parent | aaec3c819167afb3f40410142654ed4d57926b10 (diff) |
[8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests. Author: Ambal
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index b2ad38ceb47..0e7eed9bff0 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1101,17 +1101,17 @@ void WorldObject::_Create( uint32 guidlow, HighGuid guidhigh, uint32 mapid, uint uint32 WorldObject::GetZoneId() const { - return MapManager::Instance().GetBaseMap(m_mapId)->GetZoneId(m_positionX, m_positionY, m_positionZ); + return GetBaseMap()->GetZoneId(m_positionX, m_positionY, m_positionZ); } uint32 WorldObject::GetAreaId() const { - return MapManager::Instance().GetBaseMap(m_mapId)->GetAreaId(m_positionX, m_positionY, m_positionZ); + return GetBaseMap()->GetAreaId(m_positionX, m_positionY, m_positionZ); } void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const { - MapManager::Instance().GetBaseMap(m_mapId)->GetZoneAndAreaId(zoneid, areaid, m_positionX, m_positionY, m_positionZ); + GetBaseMap()->GetZoneAndAreaId(zoneid, areaid, m_positionX, m_positionY, m_positionZ); } InstanceData* WorldObject::GetInstanceData() @@ -1448,7 +1448,7 @@ void WorldObject::GetRandomPoint( float x, float y, float z, float distance, flo void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const { - float new_z = MapManager::Instance().GetBaseMap(GetMapId())->GetHeight(x,y,z,true); + float new_z = GetBaseMap()->GetHeight(x,y,z,true); if(new_z > INVALID_HEIGHT) z = new_z+ 0.05f; // just to be sure that we are not a few pixel under the surface } @@ -1679,7 +1679,7 @@ Map* WorldObject::_findMap() Map const* WorldObject::GetBaseMap() const { - return MapManager::Instance().GetBaseMap(GetMapId()); + return MapManager::Instance().CreateBaseMap(GetMapId()); } void WorldObject::AddObjectToRemoveList() |