[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:
1 parent
aaec3c8191
commit
3cf2be6042
26 files changed
+104
-100
No files matched your search
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user