From 4b12fb98f36302c346ebab345290c5cce9464450 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 20 Jul 2025 22:53:11 +0100 Subject: [PATCH] Removed some null props --- .../SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs | 10 +++++----- Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs index 0f269448..cb1c8aa3 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs @@ -581,8 +581,8 @@ public class BotGeneratorHelper( } // Get container details from db - var (key, value) = itemHelper.GetItem(container.Template); - if (!key) + var (isValidItem, itemDbDetails) = itemHelper.GetItem(container.Template); + if (!isValidItem) { logger.Warning( serverLocalisationService.GetText( @@ -595,7 +595,7 @@ public class BotGeneratorHelper( continue; } - if (value?.Properties?.Grids?.Count == 0) + if (itemDbDetails?.Properties?.Grids?.Count == 0) // Container has no slots to hold items { continue; @@ -610,8 +610,8 @@ public class BotGeneratorHelper( // Iterate over each grid in the container and look for a big enough space for the item to be placed in var currentGridCount = 1; - var totalSlotGridCount = value?.Properties?.Grids?.Count; - foreach (var slotGrid in value?.Properties?.Grids ?? []) + var totalSlotGridCount = itemDbDetails?.Properties?.Grids?.Count; + foreach (var slotGrid in itemDbDetails?.Properties?.Grids ?? []) { // Grid is empty, skip or item size is bigger than grid if ( diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs index 7dfcdc37..9600af26 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Bots/Bots.cs @@ -9,11 +9,11 @@ public record Bots public Dictionary? ExtensionData { get; set; } [JsonPropertyName("types")] - public Dictionary? Types { get; set; } + public Dictionary Types { get; set; } [JsonPropertyName("base")] - public BotBase? Base { get; set; } + public BotBase Base { get; set; } [JsonPropertyName("core")] - public Dictionary? Core { get; set; } + public Dictionary Core { get; set; } }