diff --git a/src/zr/playerclasses/healthregen.inc b/src/zr/playerclasses/healthregen.inc index b3afa62..3bdfa89 100644 --- a/src/zr/playerclasses/healthregen.inc +++ b/src/zr/playerclasses/healthregen.inc @@ -99,17 +99,19 @@ 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]) + // Check if the health is below the limit. + if (health < ClientHealthRegenMax[client]) { - health = ClientHealthRegenMax[client]; - } + // Apply the health regen. + health += ClientHealthRegenAmount[client]; + + // Clamp the health regen to the limit. + if (health > ClientHealthRegenMax[client]) + { + health = ClientHealthRegenMax[client]; + } - // Check if the health points is below the limit. - if (health <= ClientHealthRegenMax[client]) - { // Increase health. SetEntityHealth(client, health); }