From 90e0c2c4b9f24dfea504f0713b94cf4b8bc4e3dc Mon Sep 17 00:00:00 2001 From: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:41:05 -0800 Subject: [PATCH] Resolve missing static forced containers/weapons when using loot dumps from multiple versions Instead of only using the static forced containers from the first dump, merge all static forced containers so we can utilize dumps from multiple versions --- .../MultithreadSteppedDumpProcessor.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs index f83d9c1..4b1c41b 100644 --- a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs +++ b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs @@ -66,18 +66,31 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor var mapId = dataDump.Data.LocationLoot.Id.ToLower(); - // the if statement below takes care of processing "forced" or real static data for each map, only need - // to do this once per map, we dont care about doing it again + // Because we may use multiple version dumps for map data, merge the static loot between dumps lock (staticContainersLock) { - if (!staticContainers.ContainsKey(mapId)) + if (!staticContainers.TryGetValue(mapId, out var mapStaticLoot)) { if (LoggerFactory.GetInstance().CanBeLogged(LogLevel.Info)) LoggerFactory.GetInstance().Log($"Doing first time process for map {mapId} of real static data", LogLevel.Info); - var mapStaticContainers = StaticLootProcessor.CreateStaticWeaponsAndStaticForcedContainers(dataDump); + + staticContainers[mapId] = new MapStaticLoot + { + StaticWeapons = new List