From d8987d55f77312a9ec1b7fd2c044e4ac1cbe15ff Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 20 Aug 2025 12:05:47 +0100 Subject: [PATCH] Renamed method to `TryAddItemToBotContainer` --- Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs | 2 +- .../Services/BotInventoryContainerService.cs | 2 +- Testing/UnitTests/Tests/Helpers/BotGeneratorHelperTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs index 5574d8f4..dc7e2ed6 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/BotGeneratorHelper.cs @@ -501,7 +501,7 @@ public class BotGeneratorHelper( // Get x/y grid size of item var (itemWidth, itemHeight) = inventoryHelper.GetItemSize(rootItemTplId, rootItemId, itemWithChildrenList); - var result = botInventoryContainerService.AddItemToBotContainer( + var result = botInventoryContainerService.TryAddItemToBotContainer( botId, equipmentSlotId, itemWithChildrenList, diff --git a/Libraries/SPTarkov.Server.Core/Services/BotInventoryContainerService.cs b/Libraries/SPTarkov.Server.Core/Services/BotInventoryContainerService.cs index b953995c..bce25155 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BotInventoryContainerService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BotInventoryContainerService.cs @@ -50,7 +50,7 @@ public class BotInventoryContainerService(ISptLogger logger, /// Width of item with its children /// Height of item with its children /// ItemAddedResult - public ItemAddedResult AddItemToBotContainer( + public ItemAddedResult TryAddItemToBotContainer( MongoId botId, EquipmentSlots containerName, List itemAndChildren, diff --git a/Testing/UnitTests/Tests/Helpers/BotGeneratorHelperTests.cs b/Testing/UnitTests/Tests/Helpers/BotGeneratorHelperTests.cs index f3a0a2c7..75cd65dc 100644 --- a/Testing/UnitTests/Tests/Helpers/BotGeneratorHelperTests.cs +++ b/Testing/UnitTests/Tests/Helpers/BotGeneratorHelperTests.cs @@ -190,7 +190,7 @@ public class BotGeneratorHelperTests }, Upd = new Upd { StackObjectsCount = 1 }, }; - _botInventoryContainerService.AddItemToBotContainer(botId, EquipmentSlots.Backpack, [akbsCartridge], botInventory, 1, 1); + _botInventoryContainerService.TryAddItemToBotContainer(botId, EquipmentSlots.Backpack, [akbsCartridge], botInventory, 1, 1); var rootWeaponId = new MongoId(); var weaponWithChildren = CreateMp18(rootWeaponId);