Set correct type on global LocationInfection

This commit is contained in:
Archangel
2025-09-17 20:46:43 +02:00
parent 0c471cf3c1
commit 6a4efe9e53
2 changed files with 3 additions and 3 deletions
@@ -12,7 +12,7 @@ public record Globals
public required Config Configuration { get; init; }
[JsonPropertyName("LocationInfection")]
public required LocationInfection LocationInfection { get; init; }
public required Dictionary<string, int> LocationInfection { get; init; }
[JsonPropertyName("bot_presets")]
public required IEnumerable<BotPreset> BotPresets { get; init; }
@@ -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)