From db490d215c249576d4c170a5efa1966f5e726c44 Mon Sep 17 00:00:00 2001 From: CWX Date: Wed, 15 Jan 2025 12:43:58 +0000 Subject: [PATCH] fix type, fix changes to logic --- Core/Generators/BotGenerator.cs | 6 +++--- Core/Generators/PlayerScavGenerator.cs | 2 +- Core/Models/Eft/Common/Tables/BotType.cs | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Core/Generators/BotGenerator.cs b/Core/Generators/BotGenerator.cs index 85b1badd..a6607b58 100644 --- a/Core/Generators/BotGenerator.cs +++ b/Core/Generators/BotGenerator.cs @@ -495,9 +495,9 @@ public class BotGenerator var chosenBodyTemplate = _databaseService.GetCustomization()[bot.Customization.Body]; // Some bodies have matching hands, look up body to see if this is the case - var chosenBody = bodyGlobalDictDb[chosenBodyTemplate?.Name.Trim()]; - bot.Customization.Hands = chosenBody?.IsNotRandom ?? false - ? chosenBody.Hands // Has fixed hands for chosen body, update to match + var chosenBody = bodyGlobalDictDb.FirstOrDefault(c => c.Key == chosenBodyTemplate?.Name.Trim()); + bot.Customization.Hands = chosenBody.Value.IsNotRandom ?? false + ? chosenBody.Value.Hands // Has fixed hands for chosen body, update to match : _weightedRandomHelper.GetWeightedValue(appearance.Hands); // Hands can be random, choose any from weighted dict } diff --git a/Core/Generators/PlayerScavGenerator.cs b/Core/Generators/PlayerScavGenerator.cs index e93fcf4e..13eb85b2 100644 --- a/Core/Generators/PlayerScavGenerator.cs +++ b/Core/Generators/PlayerScavGenerator.cs @@ -281,7 +281,7 @@ public class PlayerScavGenerator var props = baseBotNode.BotGeneration.Items.GetType().GetProperties(); foreach (var itemLimitKvP in karmaSettings.ItemLimits) { - var prop = props.FirstOrDefault(x => x.Name == itemLimitKvP.Key); + var prop = props.FirstOrDefault(x => x.Name.ToLower() == itemLimitKvP.Key.ToLower()); prop.SetValue(baseBotNode.BotGeneration.Items, itemLimitKvP.Value); } diff --git a/Core/Models/Eft/Common/Tables/BotType.cs b/Core/Models/Eft/Common/Tables/BotType.cs index fd142c1d..ccc92bd2 100644 --- a/Core/Models/Eft/Common/Tables/BotType.cs +++ b/Core/Models/Eft/Common/Tables/BotType.cs @@ -348,6 +348,9 @@ public class GenerationWeightingItems [JsonPropertyName("specialItems")] public GenerationData SpecialItems { get; set; } + + [JsonPropertyName("looseLoot")] + public GenerationData LooseLoot { get; set; } } public class BotTypeHealth