[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:
Ambal 2009-06-16 12:20:11 +04:00 committed by AlexDereka
parent 1187c8698c
commit b76c4c2f3c
29 changed files with 99 additions and 99 deletions

View file

@ -38,16 +38,15 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
public:
Map* GetMap(uint32, const WorldObject* obj);
Map* FindMap(uint32 mapid) { return _findMap(mapid); }
Map* FindMap(uint32 mapid, uint32 instanceId);
Map const* CreateBaseMap(uint32 id) const { return const_cast<MapManager*>(this)->_createBaseMap(id); }
Map* FindMap(uint32 mapid, uint32 instanceId = 0) const;
// only const version for outer users
Map const* GetBaseMap(uint32 id) const { return const_cast<MapManager*>(this)->_GetBaseMap(id); }
void DeleteInstance(uint32 mapid, uint32 instanceId);
uint16 GetAreaFlag(uint32 mapid, float x, float y, float z) const
{
Map const* m = GetBaseMap(mapid);
Map const* m = CreateBaseMap(mapid);
return m->GetAreaFlag(x, y, z);
}
uint32 GetAreaId(uint32 mapid, float x, float y, float z) const
@ -83,7 +82,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
i_timer.Reset();
}
void LoadGrid(int mapid, float x, float y, const WorldObject* obj, bool no_unload = false);
//void LoadGrid(int mapid, int instId, float x, float y, const WorldObject* obj, bool no_unload = false);
void UnloadAll();
static bool ExistMapAndVMap(uint32 mapid, float x, float y);
@ -106,7 +105,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
static bool IsValidMapCoord(WorldLocation const& loc)
{
return IsValidMapCoord(loc.mapid,loc.x,loc.y,loc.z,loc.o);
return IsValidMapCoord(loc.mapid,loc.coord_x,loc.coord_y,loc.coord_z,loc.orientation);
}
void DoDelayedMovesAndRemoves();
@ -140,7 +139,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
MapManager(const MapManager &);
MapManager& operator=(const MapManager &);
Map* _GetBaseMap(uint32 id);
Map* _createBaseMap(uint32 id);
Map* _findMap(uint32 id) const
{
MapMapType::const_iterator iter = i_maps.find(id);