From 45fbd198d0c5ca4df76fbd77e8c5d09ba35f2f3d Mon Sep 17 00:00:00 2001 From: KaenoDev <193943350+KaenoDev@users.noreply.github.com> Date: Mon, 3 Feb 2025 19:38:25 +0000 Subject: [PATCH] Fix Botcaps not getting set correctly --- Libraries/Core/Models/Spt/Server/Locations.cs | 7 ++++++- Libraries/Core/Services/PostDbLoadService.cs | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Libraries/Core/Models/Spt/Server/Locations.cs b/Libraries/Core/Models/Spt/Server/Locations.cs index a208f564..200c700a 100644 --- a/Libraries/Core/Models/Spt/Server/Locations.cs +++ b/Libraries/Core/Models/Spt/Server/Locations.cs @@ -81,10 +81,15 @@ public record Locations return _locationDictionaryCache; } + public string GetMappedKey(string key) + { + return _locationMappings.TryGetValue(key, out var value) ? value : key; + } + private Dictionary _locationMappings = new() { { "factory4_day", "Factory4Day" }, - { "bigmap", "bigmap" }, + { "bigmap", "Bigmap" }, { "develop", "Develop" }, { "factory4_night", "Factory4Night" }, { "hideout", "Hideout" }, diff --git a/Libraries/Core/Services/PostDbLoadService.cs b/Libraries/Core/Services/PostDbLoadService.cs index aff919cb..2516c37d 100644 --- a/Libraries/Core/Services/PostDbLoadService.cs +++ b/Libraries/Core/Services/PostDbLoadService.cs @@ -283,11 +283,13 @@ public class PostDbLoadService( } } + + // TODO: CWX Change the way we get Maps protected void AdjustLocationBotValues() { var mapsDb = _databaseService.GetLocations().GetDictionary(); foreach (var (key, cap) in _botConfig.MaxBotCap) { - if (!mapsDb.TryGetValue(key, out var map)) + if (!mapsDb.TryGetValue(_databaseService.GetLocations().GetMappedKey(key), out var map)) { continue; }