From 242677ac6b9388ef6628f9d3217da0c6f958448b Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 13 Aug 2023 20:44:40 +0100 Subject: [PATCH] bug fix probability --- .../MultithreadSteppedDumpProcessor.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs index 8839f20..b9802dd 100644 --- a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs +++ b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs @@ -50,14 +50,6 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor { LoggerFactory.GetInstance().Log($"Processing static data for file {dumped.BasicInfo.FileName}", LogLevel.Info); var data = _jsonSerializer.Deserialize(File.ReadAllText(dumped.BasicInfo.FileName)); - // the if statement below will keep track of how many dumps we have for each map - lock (mapDumpCounterLock) - { - if (mapDumpCounter.ContainsKey(data.Data.Name)) - mapDumpCounter[data.Data.Name] += 1; - else - mapDumpCounter.Add(data.Data.Name, 1); - } // the if statement below takes care of processing "forced" or real static data for each map, we only need // to do this once per map, so we dont care about doing it again lock (staticContainersLock) @@ -87,6 +79,15 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor fileDate.Value > LootDumpProcessorContext.GetConfig().DumpProcessorConfig .SpawnContainerChanceIncludeAfterDate) { + // the if statement below will keep track of how many dumps we have for each map + lock (mapDumpCounterLock) + { + if (mapDumpCounter.ContainsKey(data.Data.Name)) + mapDumpCounter[data.Data.Name] += 1; + else + mapDumpCounter.Add(data.Data.Name, 1); + } + foreach (var dynamicStaticContainer in StaticLootProcessor.CreateDynamicStaticContainers(data)) { lock (mapStaticContainersAggregatedLock)