Fix Botcaps not getting set correctly

This commit is contained in:
KaenoDev
2025-02-03 19:38:25 +00:00
parent e1cd19933f
commit 45fbd198d0
2 changed files with 9 additions and 2 deletions
@@ -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<string, string> _locationMappings = new()
{
{ "factory4_day", "Factory4Day" },
{ "bigmap", "bigmap" },
{ "bigmap", "Bigmap" },
{ "develop", "Develop" },
{ "factory4_night", "Factory4Night" },
{ "hideout", "Hideout" },
+3 -1
View File
@@ -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;
}