diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2020-02-08 20:22:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-08 20:22:37 +0100 |
| commit | 9304e496cbf6ab6c028671fb8526c732ae5d799f (patch) | |
| tree | 997040bf14477bbd30b9b175aac93fa287de03e1 /src/server/game/Pools | |
| parent | 726d5e91b55d4742dcbd6b0a82d84788dbb117b7 (diff) | |
Core/Misc: Some refactoring, #23603 prep: (#23676)
- Split SpawnMetadata off from SpawnData
- No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Diffstat (limited to 'src/server/game/Pools')
| -rw-r--r-- | src/server/game/Pools/PoolMgr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 83be9b7990b..45407c4c5aa 100644 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -170,7 +170,7 @@ void PoolGroup<Creature>::Despawn1Object(ObjectGuid::LowType guid) { sObjectMgr->RemoveCreatureFromGrid(guid, data); - Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId()); + Map* map = sMapMgr->CreateBaseMap(data->mapId); if (!map->Instanceable()) { auto creatureBounds = map->GetCreatureBySpawnIdStore().equal_range(guid); @@ -195,7 +195,7 @@ void PoolGroup<GameObject>::Despawn1Object(ObjectGuid::LowType guid) { sObjectMgr->RemoveGameobjectFromGrid(guid, data); - Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId()); + Map* map = sMapMgr->CreateBaseMap(data->mapId); if (!map->Instanceable()) { auto gameobjectBounds = map->GetGameObjectBySpawnIdStore().equal_range(guid); @@ -316,7 +316,7 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj) sObjectMgr->AddCreatureToGrid(obj->guid, data); // Spawn if necessary (loaded grids only) - Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId()); + Map* map = sMapMgr->CreateBaseMap(data->mapId); // We use spawn coords to spawn if (!map->Instanceable() && map->IsGridLoaded(data->spawnPoint)) { @@ -340,7 +340,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj) sObjectMgr->AddGameobjectToGrid(obj->guid, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId()); + Map* map = sMapMgr->CreateBaseMap(data->mapId); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsGridLoaded(data->spawnPoint)) { |
