fix type, fix changes to logic

This commit is contained in:
CWX
2025-01-15 12:43:58 +00:00
parent f18ab1814e
commit db490d215c
3 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -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<string>(appearance.Hands); // Hands can be random, choose any from weighted dict
}
+1 -1
View File
@@ -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);
}
+3
View File
@@ -348,6 +348,9 @@ public class GenerationWeightingItems
[JsonPropertyName("specialItems")]
public GenerationData SpecialItems { get; set; }
[JsonPropertyName("looseLoot")]
public GenerationData LooseLoot { get; set; }
}
public class BotTypeHealth