[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
This commit is contained in:
@@ -40,16 +40,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
|
||||
@@ -85,7 +84,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);
|
||||
@@ -108,7 +107,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();
|
||||
@@ -142,7 +141,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);
|
||||
|
||||
Reference in New Issue
Block a user