aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-10-17 15:48:02 +0200
committerShauren <shauren.trinity@gmail.com>2023-10-17 15:57:03 +0200
commit966936b01ab732c84832be93fb136da63112cc75 (patch)
tree13774c92d604ac231f2ebbb2d718af967d145acd /src/server/game/Globals/ObjectMgr.cpp
parentd028bb0e374acfc635b2f6f224f5732d3bfa13fd (diff)
Core/Misc: Fixed thread-unsafe access to list of objects that should be spawned in a cell
Closes #29372 (cherry picked from commit 7b6589c1ecc159f6949c5535785fba79a04b2c4a)
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 301ff49ec8e..67bf9047c82 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2338,6 +2338,19 @@ void ObjectMgr::LoadCreatures()
TC_LOG_INFO("server.loading", ">> Loaded {} creatures in {} ms", _creatureDataStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
+CellObjectGuids const* ObjectMgr::GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
+{
+ if (CellObjectGuidsMap const* mapGuids = Trinity::Containers::MapGetValuePtr(_mapObjectGuidsStore, MAKE_PAIR32(mapid, spawnMode)))
+ return Trinity::Containers::MapGetValuePtr(*mapGuids, cell_id);
+
+ return nullptr;
+}
+
+CellObjectGuidsMap const* ObjectMgr::GetMapObjectGuids(uint16 mapid, uint8 spawnMode)
+{
+ return Trinity::Containers::MapGetValuePtr(_mapObjectGuidsStore, MAKE_PAIR32(mapid, spawnMode));
+}
+
void ObjectMgr::AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const* data)
{
uint8 mask = data->spawnMask;