General: Clamp health regen to max instead.

Cause before it wouldnt apply if the health + regen > max health regen.
Now it clamps instead :>
This commit is contained in:
zaCade 2018-07-29 15:05:33 +02:00
parent 9b2dc6f721
commit 870ef51197
1 changed files with 7 additions and 1 deletions

View File

@ -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);