From 6a4efe9e53a3d61df2bb149250cb7e96f1f72500 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 17 Sep 2025 20:46:43 +0200 Subject: [PATCH] Set correct type on global LocationInfection --- Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs | 2 +- .../SPTarkov.Server.Core/Services/SeasonalEventService.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs index 4ca9e157..883b9551 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Globals.cs @@ -12,7 +12,7 @@ public record Globals public required Config Configuration { get; init; } [JsonPropertyName("LocationInfection")] - public required LocationInfection LocationInfection { get; init; } + public required Dictionary LocationInfection { get; init; } [JsonPropertyName("bot_presets")] public required IEnumerable BotPresets { get; init; } diff --git a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs index acba63b6..3236c6c7 100644 --- a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs @@ -738,7 +738,7 @@ public class SeasonalEventService( infectionHalloween.DisplayUIEnabled = true; infectionHalloween.Enabled = true; - var globalInfectionDict = globals.LocationInfection.GetAllPropertiesAsDictionary(); + var globalInfectionDict = globals.LocationInfection; foreach (var (locationId, infectionPercentage) in zombieSettings.MapInfectionAmount) { // calculate a random value unless the rate is 100 @@ -758,7 +758,7 @@ public class SeasonalEventService( } // Globals data needs value updated too - globalInfectionDict[locationId] = randomInfectionPercentage; + globalInfectionDict[locationId] = Convert.ToInt32(randomInfectionPercentage); } foreach (var locationId in zombieSettings.DisableBosses)