[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

@ -568,7 +568,10 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
sObjectMgr.AddCreatureToGrid(*itr, 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
if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY))
{
@ -614,7 +617,10 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
// 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
if(!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{