diff --git a/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs b/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs new file mode 100644 index 00000000..df5e8429 --- /dev/null +++ b/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs @@ -0,0 +1,19 @@ +using SPTarkov.Server.Core.Models.Eft.Profile; + +namespace SPTarkov.Server.Core.Extensions +{ + public static class FullProfileExtensions + { + public static void StoreHydrationEnergyTempInProfile( + this SptProfile fullProfile, + double hydration, + double energy, + double temperature + ) + { + fullProfile.VitalityData.Hydration = hydration; + fullProfile.VitalityData.Energy = energy; + fullProfile.VitalityData.Temperature = temperature; + } + } +} diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs index 907d39b9..025ad36c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HealthHelper.cs @@ -58,8 +58,7 @@ public class HealthHelper( var defaultTemperature = matchingSide?.Character?.Health?.Temperature ?? new CurrentMinMax { Current = 36.6 }; - StoreHydrationEnergyTempInProfile( - fullProfile, + fullProfile.StoreHydrationEnergyTempInProfile( postRaidHealth.Hydration.Current ?? 0, postRaidHealth.Energy.Current ?? 0, defaultTemperature.Current ?? 0 // Reset profile temp to the default to prevent very cold/hot temps persisting into next raid @@ -104,18 +103,6 @@ public class HealthHelper( pmcData.Health.UpdateTime = _timeUtil.GetTimeStamp(); } - protected void StoreHydrationEnergyTempInProfile( - SptProfile fullProfile, - double hydration, - double energy, - double temperature - ) - { - fullProfile.VitalityData.Hydration = hydration; - fullProfile.VitalityData.Energy = energy; - fullProfile.VitalityData.Temperature = temperature; - } - /// /// Take body part effects from client profile and apply to server profile /// @@ -269,7 +256,6 @@ public class HealthHelper( /// Add effect to body part in profile /// /// Player profile - /// Body part to edit /// Effect to add to body part /// How long the effect has left in seconds (-1 by default, no duration). protected void AddEffect(