[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
2009-06-16 11:19:59 -05:00
parent aaec3c8191
commit 3cf2be6042
26 changed files with 104 additions and 100 deletions

View File

@@ -233,7 +233,7 @@ bool PoolGroup<Creature>::Spawn1Object(uint32 guid)
objmgr.AddCreatureToGrid(guid, data);
// Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(MapManager::Instance().GetBaseMap(data->mapid));
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
// We use spawn coords to spawn
if (!map->Instanceable() && !map->IsRemovalGrid(data->posX, data->posY))
{
@@ -263,7 +263,7 @@ bool PoolGroup<GameObject>::Spawn1Object(uint32 guid)
objmgr.AddGameobjectToGrid(guid, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(MapManager::Instance().GetBaseMap(data->mapid));
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
// We use current coords to unspawn, not spawn coords since creature can have changed grid
if (!map->Instanceable() && !map->IsRemovalGrid(data->posX, data->posY))
{