Add back incorrectly removed properties that are accessed via reflection + improved dictionary access

This commit is contained in:
Chomp
2025-07-14 15:42:50 +01:00
parent 04ffbce106
commit fba084639c
2 changed files with 42 additions and 2 deletions
@@ -265,8 +265,12 @@ public class BotGeneratorHelper(
return defaultValue;
}
var botEquipmentSettings = _botConfig.Equipment[GetBotEquipmentRole(botRole)];
if (botEquipmentSettings is null)
if (
!_botConfig.Equipment.TryGetValue(
GetBotEquipmentRole(botRole),
out var botEquipmentSettings
)
)
{
logger.Warning(
serverLocalisationService.GetText(
@@ -257,6 +257,42 @@ public record EquipmentFilters
[JsonPropertyName("armorPlateWeighting")]
public List<ArmorPlateWeights>? ArmorPlateWeighting { get; set; }
/// <summary>
/// Chance face shield is down/active
/// </summary>
[JsonPropertyName("faceShieldIsActiveChancePercent")]
public double? FaceShieldIsActiveChancePercent { get; set; }
/// <summary>
/// Chance gun flashlight is active during the day
/// </summary>
[JsonPropertyName("lightIsActiveDayChancePercent")]
public double? LightIsActiveDayChancePercent { get; set; }
/// <summary>
/// Chance gun flashlight is active during the night
/// </summary>
[JsonPropertyName("lightIsActiveNightChancePercent")]
public double? LightIsActiveNightChancePercent { get; set; }
/// <summary>
/// Chance gun laser is active during the day
/// </summary>
[JsonPropertyName("laserIsActiveChancePercent")]
public double? LaserIsActiveChancePercent { get; set; }
/// <summary>
/// Chance NODS are down/active during the day
/// </summary>
[JsonPropertyName("nvgIsActiveChanceDayPercent")]
public double? NvgIsActiveChanceDayPercent { get; set; }
/// <summary>
/// Chance NODS are down/active during the night
/// </summary>
[JsonPropertyName("nvgIsActiveChanceNightPercent")]
public double? NvgIsActiveChanceNightPercent { get; set; }
[JsonPropertyName("forceRigWhenNoVest")]
public bool? ForceRigWhenNoVest { get; set; }
}