Added safer dictionary access inside GetLootFromCache

This commit is contained in:
Chomp
2025-06-02 16:09:39 +01:00
parent 0577b119ca
commit 2ae91b4c38
@@ -62,11 +62,13 @@ public class BotLootCacheService(
AddLootToCache(botRole, isPmc, botJsonTemplate);
}
if(!_lootCache.TryGetValue(botRole, out var botRoleCache))
{
_logger.Error($"Unable to find: {botRole} in loot cache");
return [];
}
Dictionary<string, double> result = null;
BotLootCache botRoleCache;
botRoleCache = _lootCache[botRole];
switch (lootType)
{
case LootCacheType.Special: