From 870ef511970c1b490ce40c3807fbf2aa4811144d Mon Sep 17 00:00:00 2001 From: zaCade Date: Sun, 29 Jul 2018 15:05:33 +0200 Subject: [PATCH] General: Clamp health regen to max instead. Cause before it wouldnt apply if the health + regen > max health regen. Now it clamps instead :> --- src/zr/playerclasses/healthregen.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/zr/playerclasses/healthregen.inc b/src/zr/playerclasses/healthregen.inc index 595d002..b3afa62 100644 --- a/src/zr/playerclasses/healthregen.inc +++ b/src/zr/playerclasses/healthregen.inc @@ -101,8 +101,14 @@ public Action:ClassHealthRegenTimer(Handle:timer, any:client) new health = GetClientHealth(client); health += ClientHealthRegenAmount[client]; + // Clamp the health points to the maximum. + if (health > ClientHealthRegenMax[client]) + { + health = ClientHealthRegenMax[client]; + } + // Check if the health points is below the limit. - if (health < ClientHealthRegenMax[client]) + if (health <= ClientHealthRegenMax[client]) { // Increase health. SetEntityHealth(client, health);