[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:
megamage committed 2009-06-16 11:19:59 -05:00
1 parent aaec3c8191
commit 3cf2be6042
26 files changed
+104 -100

No files matched your search

+2 -2
View File
@@ -1405,7 +1405,7 @@ uint32 ObjectMgr::AddGameObject(uint32 entry, uint32 mapId, float x, float y, fl
AddGameobjectToGrid(guid, &data);
// Spawn if necessary (loaded grids only)
if(Map* map = const_cast<Map*>(MapManager::Instance().GetBaseMap(mapId)))
if(Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(mapId)))
{
// We use spawn coords to spawn
if(!map->Instanceable() && !map->IsRemovalGrid(x, y))
@@ -1454,7 +1454,7 @@ uint32 ObjectMgr::AddCreature(uint32 entry, uint32 team, uint32 mapId, float x,
AddCreatureToGrid(guid, &data);
// Spawn if necessary (loaded grids only)
if(Map* map = const_cast<Map*>(MapManager::Instance().GetBaseMap(mapId)))
if(Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(mapId)))
{
// We use spawn coords to spawn
if(!map->Instanceable() && !map->IsRemovalGrid(x, y))