From 1f74ebc92087f237ce6bb9194116add6b30d1982 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 27 Jan 2025 08:36:38 +0000 Subject: [PATCH] Small cleanup of how the pocket pool is gathered --- Libraries/Core/Generators/BotInventoryGenerator.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Libraries/Core/Generators/BotInventoryGenerator.cs b/Libraries/Core/Generators/BotInventoryGenerator.cs index 625c8747..a8b610c7 100644 --- a/Libraries/Core/Generators/BotInventoryGenerator.cs +++ b/Libraries/Core/Generators/BotInventoryGenerator.cs @@ -213,11 +213,8 @@ public class BotInventoryGenerator( new GenerateEquipmentProperties { RootEquipmentSlot = EquipmentSlots.Pockets, - // Unheard profiles have unique sized pockets, TODO - handle this somewhere else in a better way - RootEquipmentPool = - chosenGameVersion == GameEditions.UNHEARD - ? new Dictionary { [ItemTpl.POCKETS_1X4_TUE] = 1 } - : templateInventory.Equipment[EquipmentSlots.Pockets], + // Unheard profiles have unique sized pockets + RootEquipmentPool = GetPocketPoolByGameEdition(chosenGameVersion, templateInventory), ModPool = templateInventory.Mods, SpawnChances = wornItemChances, BotData = new BotData { Role = botRole, Level = botLevel, EquipmentRole = botEquipmentRole }, @@ -325,6 +322,13 @@ public class BotInventoryGenerator( ); } + protected Dictionary GetPocketPoolByGameEdition(string chosenGameVersion, BotTypeInventory templateInventory) + { + return chosenGameVersion == GameEditions.UNHEARD + ? new Dictionary { [ItemTpl.POCKETS_1X4_TUE] = 1 } + : templateInventory.Equipment.GetValueOrDefault(EquipmentSlots.Pockets); + } + /// /// Remove non-armored rigs from parameter data ///