fix null guard
This commit is contained in:
@@ -497,7 +497,7 @@ public class BotGenerator
|
||||
|
||||
// Some bodies have matching hands, look up body to see if this is the case
|
||||
var chosenBody = bodyGlobalDictDb.FirstOrDefault(c => c.Key == chosenBodyTemplate?.Name.Trim());
|
||||
bot.Customization.Hands = chosenBody.Value.IsNotRandom ?? false
|
||||
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
|
||||
}
|
||||
|
||||
@@ -78,7 +78,13 @@ public class BotEquipmentFilterService
|
||||
/// <returns>Dictionary of weapon type and their whitelisted scope types</returns>
|
||||
public Dictionary<string, List<string>> GetBotWeaponSightWhitelist(string botEquipmentRole)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var botEquipmentSettings = _botConfig.Equipment[botEquipmentRole];
|
||||
|
||||
if (botEquipmentSettings is null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return botEquipmentSettings.WeaponSightWhitelist;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user