From a3c3cad8251d68c0f6c7bd651545b1e5639d1d64 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 28 May 2025 12:28:02 +0100 Subject: [PATCH] Fixed scav runs not setting loot to non-FIR after runthrough #279 --- .../Services/LocationLifecycleService.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs index 079f4df4..1f1cf279 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs @@ -462,7 +462,7 @@ public class LocationLifecycleService if (!isPmc) { - HandlePostRaidPlayerScav(sessionId, pmcProfile, scavProfile, isDead, isTransfer, request); + HandlePostRaidPlayerScav(sessionId, pmcProfile, scavProfile, isDead, isTransfer, isSurvived, request); return; } @@ -649,20 +649,31 @@ public class LocationLifecycleService return _inRaidConfig.CoopExtracts.Contains(extractName.Trim()); } + /// + /// Perform post-raid profile changes + /// + /// Player id + /// Players PMC profile + /// Players scav profile + /// Did player die + /// Did player transfer to new map + /// DId player get 'survived' exit status + /// End raid request protected void HandlePostRaidPlayerScav( string sessionId, PmcData pmcProfile, PmcData scavProfile, bool isDead, bool isTransfer, + bool isSurvived, EndLocalRaidRequestData request) { var postRaidProfile = request.Results.Profile; - - if (isTransfer) + if (isTransfer || request.Results.Result == ExitStatus.RUNNER) { // We want scav inventory to persist into next raid when pscav is moving between maps - _inRaidHelper.SetInventory(sessionId, scavProfile, postRaidProfile, true, isTransfer); + // May have been run through, set gear to non-FiR + _inRaidHelper.SetInventory(sessionId, scavProfile, postRaidProfile, isSurvived, isTransfer); } scavProfile.Info.Level = request.Results.Profile.Info.Level;