From ba70911de3ed0b63d6cfd091d1bc3aef76215dbc Mon Sep 17 00:00:00 2001 From: hulkhan22 Date: Tue, 29 Apr 2025 19:44:03 +0200 Subject: [PATCH] Fix health and hydration regen --- Libraries/SPTarkov.Server.Core/Controllers/GameController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs index 7924784e..cfb96658 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs @@ -352,7 +352,7 @@ public class GameController( .Aggregate(0d, (sum, bonus) => sum + bonus.Value!.Value); // Player has energy deficit - if (Math.Abs(pmcProfile.Health?.Energy?.Current - pmcProfile.Health?.Energy?.Maximum ?? 1) <= _deviation) + if (pmcProfile.Health?.Energy?.Current - pmcProfile.Health?.Energy?.Maximum <= _deviation) { // Set new value, whatever is smallest pmcProfile.Health!.Energy!.Current += Math.Round(energyRegenPerHour * (diffSeconds!.Value / 3600)); @@ -363,7 +363,7 @@ public class GameController( } // Player has hydration deficit - if (Math.Abs(pmcProfile.Health?.Hydration?.Current - pmcProfile.Health?.Hydration?.Maximum ?? 1) <= _deviation) + if (pmcProfile.Health?.Hydration?.Current - pmcProfile.Health?.Hydration?.Maximum <= _deviation) { pmcProfile.Health!.Hydration!.Current += Math.Round(hydrationRegenPerHour * (diffSeconds!.Value / 3600)); if (pmcProfile.Health.Hydration.Current > pmcProfile.Health.Hydration.Maximum)