mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
parent
1187c8698c
commit
b76c4c2f3c
29 changed files with 99 additions and 99 deletions
|
|
@ -1063,17 +1063,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()
|
||||
|
|
@ -1345,7 +1345,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
|
||||
}
|
||||
|
|
@ -1578,7 +1578,7 @@ Map* WorldObject::GetMap() const
|
|||
|
||||
Map const* WorldObject::GetBaseMap() const
|
||||
{
|
||||
return MapManager::Instance().GetBaseMap(GetMapId());
|
||||
return MapManager::Instance().CreateBaseMap(GetMapId());
|
||||
}
|
||||
|
||||
void WorldObject::AddObjectToRemoveList()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue