From 74a5310de02cb42393a75b368654372e575d39ed Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 28 May 2025 11:44:14 +0100 Subject: [PATCH] Added nullguards surrounding laser and nvg checks --- Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs index 654844c2..abf604e7 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs @@ -153,7 +153,7 @@ public class BotGeneratorHelper( if (itemTemplate?.Parent == BaseClasses.FLASHLIGHT) { // Get chance from botconfig for bot type - var lightLaserActiveChance = raidSettings.IsNightRaid + var lightLaserActiveChance = raidSettings?.IsNightRaid ?? false ? GetBotEquipmentSettingFromConfig(botRole, "lightIsActiveNightChancePercent", 50) : GetBotEquipmentSettingFromConfig(botRole, "lightIsActiveDayChancePercent", 25); itemProperties.Light = new UpdLight @@ -182,7 +182,7 @@ public class BotGeneratorHelper( if (itemTemplate?.Parent == BaseClasses.NIGHTVISION) { // Get chance from botconfig for bot type - var nvgActiveChance = raidSettings.IsNightRaid + var nvgActiveChance = raidSettings?.IsNightRaid ?? false ? GetBotEquipmentSettingFromConfig(botRole, "nvgIsActiveChanceNightPercent", 90) : GetBotEquipmentSettingFromConfig(botRole, "nvgIsActiveChanceDayPercent", 15); itemProperties.Togglable = new UpdTogglable