General: Fix regen issue introduced in 870ef51197
Woops, didnt think about players that have more then the limit, when the regen would kick in.
This commit is contained in:
parent
9676fb9852
commit
dc8ea3be56
|
@ -99,17 +99,19 @@ public Action:ClassHealthRegenTimer(Handle:timer, any:client)
|
||||||
}
|
}
|
||||||
|
|
||||||
new health = GetClientHealth(client);
|
new health = GetClientHealth(client);
|
||||||
health += ClientHealthRegenAmount[client];
|
|
||||||
|
|
||||||
// Clamp the health points to the maximum.
|
// Check if the health is below the limit.
|
||||||
if (health > ClientHealthRegenMax[client])
|
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.
|
// Increase health.
|
||||||
SetEntityHealth(client, health);
|
SetEntityHealth(client, health);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user