From 09b3c9e9b9c1a3c8bb28bc3c184898e421ec630b Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 26 Jan 2025 11:09:50 +0000 Subject: [PATCH] Fixed equipment generating without mods --- Libraries/Core/Generators/BotInventoryGenerator.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/Core/Generators/BotInventoryGenerator.cs b/Libraries/Core/Generators/BotInventoryGenerator.cs index 045d6a2e..62edbe7e 100644 --- a/Libraries/Core/Generators/BotInventoryGenerator.cs +++ b/Libraries/Core/Generators/BotInventoryGenerator.cs @@ -397,7 +397,7 @@ public class BotInventoryGenerator( var shouldSpawn = _randomUtil.GetChance100(spawnChance ?? 0); if (shouldSpawn && settings.RootEquipmentPool.Any()) { - var pickedItemDb = new TemplateItem(); + TemplateItem pickedItemDb = null; var found = false; // Limit attempts to find a compatible item as it's expensive to check them all @@ -467,7 +467,7 @@ public class BotInventoryGenerator( var botEquipBlacklist = _botEquipmentFilterService.GetBotEquipmentBlacklist( settings.BotData.EquipmentRole, - (double)settings.GeneratingPlayerLevel + settings.GeneratingPlayerLevel.Value ); // Edge case: Filter the armor items mod pool if bot exists in config dict + config has armor slot @@ -481,11 +481,10 @@ public class BotInventoryGenerator( botEquipBlacklist.Equipment ); } - + var itemIsOnGenerateModBlacklist = settings.GenerateModsBlacklist != null && settings.GenerateModsBlacklist.Contains(pickedItemDb.Id); // Does item have slots for sub-mods to be inserted into if (pickedItemDb.Properties?.Slots?.Count > 0 - && settings?.GenerateModsBlacklist is not null - && !settings.GenerateModsBlacklist.Contains(pickedItemDb.Id)) + && !itemIsOnGenerateModBlacklist) { var childItemsToAdd = _botEquipmentModGenerator.GenerateModsForEquipment( [item],