Core/Misc: Fixed thread-unsafe access to list of objects that should be spawned in a cell

Port From (https://github.com/TrinityCore/TrinityCore/commit/7b6589c1ecc159f6949c5535785fba79a04b2c4a)
This commit is contained in:
hondacrx
2024-02-01 11:43:10 -05:00
parent d2edbdeecc
commit 2a7273f1ec
4 changed files with 35 additions and 32 deletions
+3 -4
View File
@@ -10376,16 +10376,15 @@ namespace Game
{
var key = (mapid, difficulty);
if (mapObjectGuidsStore.ContainsKey(key) && mapObjectGuidsStore[key].ContainsKey(cellid))
return mapObjectGuidsStore[key][cellid];
if (mapObjectGuidsStore.ContainsKey(key) && mapObjectGuidsStore[key].TryGetValue(cellid, out CellObjectGuids guids))
return guids;
return null;
}
public Dictionary<uint, CellObjectGuids> GetMapObjectGuids(uint mapid, Difficulty difficulty)
{
var key = (mapid, difficulty);
return mapObjectGuidsStore.LookupByKey(key);
return mapObjectGuidsStore.LookupByKey((mapid, difficulty));
}
public PageText GetPageText(uint pageEntry)