From 64275432df4ada11a7f9ad5d14c3759faeff1fa1 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 19 Mar 2025 17:09:38 +0000 Subject: [PATCH] Reset skill progress value inside profile on raid start instead of raid end --- .../Services/LocationLifecycleService.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs index f87ee979..36341c46 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs @@ -131,7 +131,12 @@ public class LocationLifecycleService { _logger.Debug($"Starting: {request.Location}"); - var playerProfile = _profileHelper.GetPmcProfile(sessionId); + var playerProfile = _profileHelper.GetFullProfile(sessionId); + + // Remove skill fatigue values + ResetSkillPointsEarnedDuringRaid(string.Equals(request.PlayerSide, "pmc", StringComparison.OrdinalIgnoreCase) + ? playerProfile.CharacterData.PmcData.Skills.Common + : playerProfile.CharacterData.ScavData.Skills.Common); // Raid is starting, adjust run times to reduce server load while player is in raid _ragfairConfig.RunIntervalSeconds = _ragfairConfig.RunIntervalValues.InRaid; @@ -143,7 +148,7 @@ public class LocationLifecycleService ServerSettings = _databaseService.GetLocationServices(), // TODO - is this per map or global? Profile = new ProfileInsuredItems { - InsuredItems = playerProfile.InsuredItems + InsuredItems = playerProfile.CharacterData.PmcData.InsuredItems }, LocationLoot = GenerateLocationAndLoot(request.Location, !request.ShouldSkipLootGeneration ?? true), TransitionType = TransitionType.NONE, @@ -699,9 +704,6 @@ public class LocationLifecycleService // Must occur after encyclopedia updated MergePmcAndScavEncyclopedias(scavProfile, pmcProfile); - // Remove skill fatigue values - ResetSkillPointsEarnedDuringRaid(scavProfile.Skills.Common); - // Scav died, regen scav loadout and reset timer if (isDead) { @@ -844,9 +846,6 @@ public class LocationLifecycleService // MUST occur AFTER encyclopedia updated MergePmcAndScavEncyclopedias(pmcProfile, scavProfile); - // Remove skill fatigue values - ResetSkillPointsEarnedDuringRaid(pmcProfile.Skills.Common); - // Handle temp, hydration, limb hp/effects _healthHelper.UpdateProfileHealthPostRaid(pmcProfile, postRaidProfile.Health, sessionId, isDead);