From 2e3dc27eb06bd9da5329d3063f210fce21e0985f Mon Sep 17 00:00:00 2001 From: KaenoDev <193943350+KaenoDev@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:41:02 +0000 Subject: [PATCH] Fix Car extract and coop extract --- .../Core/Services/LocationLifecycleService.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Libraries/Core/Services/LocationLifecycleService.cs b/Libraries/Core/Services/LocationLifecycleService.cs index 08567b7d..9830ae08 100644 --- a/Libraries/Core/Services/LocationLifecycleService.cs +++ b/Libraries/Core/Services/LocationLifecycleService.cs @@ -485,6 +485,11 @@ public class LocationLifecycleService */ protected void HandleCarExtract(string extractName, PmcData pmcData, string sessionId) { + pmcData.CarExtractCounts?.TryAdd(extractName, 0); + + // Increment extract count value + pmcData.CarExtractCounts[extractName] += 1; + var newFenceStanding = GetFenceStandingAfterExtract( pmcData, _inRaidConfig.CarExtractBaseStandingGain, @@ -513,10 +518,14 @@ public class LocationLifecycleService */ protected void HandleCoopExtract(string sessionId, PmcData pmcData, string extractName) { + pmcData.CoopExtractCounts?.TryAdd(extractName, 0); + + pmcData.CoopExtractCounts[extractName] += 1; + var newFenceStanding = GetFenceStandingAfterExtract( pmcData, - _inRaidConfig.CarExtractBaseStandingGain, - pmcData.CarExtractCounts[extractName]); + _inRaidConfig.CoopExtractBaseStandingGain, + pmcData.CoopExtractCounts[extractName]); var fenceId = Traders.FENCE; pmcData.TradersInfo[fenceId].Standing = newFenceStanding; @@ -525,8 +534,6 @@ public class LocationLifecycleService _traderHelper.LevelUp(fenceId, pmcData); pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max((int)pmcData.TradersInfo[fenceId].LoyaltyLevel, 1); - _logger.Debug($"Car extract: {extractName} used, total times taken: {pmcData.CarExtractCounts[extractName]}"); - // Copy updated fence rep values into scav profile to ensure consistency var scavData = _profileHelper.GetScavProfile(sessionId); scavData.TradersInfo[fenceId].Standing = pmcData.TradersInfo[fenceId].Standing;