From f2cebc4f88619b20acb09a82d19cc6f162672c30 Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 3 Jul 2025 16:37:45 +0100 Subject: [PATCH] Pass correct mongo id as parameter --- .../SPTarkov.Server.Core/Generators/BotLootGenerator.cs | 2 +- .../SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs | 7 ++++--- Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs index abdbacca..612fbb89 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs @@ -606,7 +606,7 @@ public class BotLootGenerator( var itemAddedResult = _botGeneratorHelper.AddItemWithChildrenToEquipmentSlot( equipmentSlots, newRootItemId, - itemToAddTemplate?.Id, + itemToAddTemplate.Id, itemWithChildrenToAdd, inventoryToAddItemsTo, containersIdFull diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs index 9f782d85..c0369256 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs @@ -2,6 +2,7 @@ using System.Collections.Frozen; using SPTarkov.DI.Annotations; using SPTarkov.Server.Core.Constants; using SPTarkov.Server.Core.Extensions; +using SPTarkov.Server.Core.Models.Common; using SPTarkov.Server.Core.Models.Eft.Common.Tables; using SPTarkov.Server.Core.Models.Enums; using SPTarkov.Server.Core.Models.Spt.Bots; @@ -595,15 +596,15 @@ public class BotGeneratorHelper( /// /// Slot to add item+children into /// Root item id to use as mod items parentId - /// Root itms tpl id + /// Root items tpl id /// Item to add /// Inventory to add item+children into /// /// ItemAddedResult result object public ItemAddedResult AddItemWithChildrenToEquipmentSlot( HashSet equipmentSlots, - string rootItemId, - string? rootItemTplId, + MongoId rootItemId, + MongoId rootItemTplId, List itemWithChildren, BotBaseInventory inventory, HashSet? containersIdFull = null diff --git a/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs index 21b1ea7d..58d7e4f7 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/InventoryHelper.cs @@ -668,7 +668,7 @@ public class InventoryHelper( /// Items id to get size of /// /// [width, height] - public (int, int) GetItemSize(string? itemTpl, string itemId, List inventoryItems) + public (int, int) GetItemSize(MongoId itemTpl, MongoId itemId, List inventoryItems) { // -> Prepares item Width and height returns [sizeX, sizeY] return GetSizeByInventoryItemHash(itemTpl, itemId, GetInventoryItemHash(inventoryItems));