mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
parent
1187c8698c
commit
b76c4c2f3c
29 changed files with 99 additions and 99 deletions
|
|
@ -517,7 +517,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
|||
objmgr.AddCreatureToGrid(*itr, 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))
|
||||
{
|
||||
|
|
@ -550,7 +550,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
|||
objmgr.AddGameobjectToGrid(*itr, 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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue