From 761ce2530b65f01141d3ab1c20bf06c992ded007 Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 18 Dec 2025 13:54:34 +0000 Subject: [PATCH] Fixed edge case with sending rewards to player stash would result in no space error #615 Add reward to profile prior to tools used to ensure consistency with free space check --- .../Controllers/HideoutController.cs | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs b/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs index 311e455b..cd318a72 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs @@ -886,6 +886,21 @@ public class HideoutController( serverLocalisationService.GetText("inventory-no_stash_space"), BackendErrorCodes.NotEnoughSpace ); + + return; + } + + // Add the crafting result to the stash, marked as FiR + var addItemsRequest = new AddItemsDirectRequest + { + ItemsWithModsToAdd = itemAndChildrenToSendToPlayer, + FoundInRaid = true, + UseSortingTable = false, + Callback = null, + }; + inventoryHelper.AddItemsToStash(sessionID, addItemsRequest, pmcData, output); + if (output.Warnings?.Count > 0) + { return; } @@ -908,24 +923,10 @@ public class HideoutController( } } - // Add the crafting result to the stash, marked as FiR - var addItemsRequest = new AddItemsDirectRequest - { - ItemsWithModsToAdd = itemAndChildrenToSendToPlayer, - FoundInRaid = true, - UseSortingTable = false, - Callback = null, - }; - inventoryHelper.AddItemsToStash(sessionID, addItemsRequest, pmcData, output); - if (output.Warnings?.Count > 0) - { - return; - } - - // - increment skill point for crafting - // - delete the production in profile Hideout.Production + // - Increment skill point for crafting + // - Delete the production in profile Hideout.Production // Hideout Management skill - // ? use a configuration variable for the value? + // ? Use a configuration variable for the value? var globals = databaseService.GetGlobals(); profileHelper.AddSkillPointsToPlayer( pmcData,