mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 16:37:06 +00:00
[10727] Map system re-engineered. Special thanks to Blueboy for tests.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
f5e40a5fda
commit
f67d89f109
43 changed files with 1254 additions and 1128 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue