[10727] Map system re-engineered. Special thanks to Blueboy for tests.

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2010-11-16 21:07:58 +02:00
parent f5e40a5fda
commit f67d89f109
43 changed files with 1254 additions and 1128 deletions

View file

@ -368,7 +368,10 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj, bool instantly)
sObjectMgr.AddCreatureToGrid(obj->guid, data);
// Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.FindMap(data->mapid));
if(!map)
return;
// We use spawn coords to spawn (avoid work for instances until implemented support)
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
@ -408,7 +411,10 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj, bool instantly)
sObjectMgr.AddGameobjectToGrid(obj->guid, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existing
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.FindMap(data->mapid));
if(!map)
return;
// We use current coords to unspawn, not spawn coords since creature can have changed grid
// (avoid work for instances until implemented support)
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))