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:
parent
9b2dc6f721
commit
870ef51197
|
@ -101,8 +101,14 @@ public Action:ClassHealthRegenTimer(Handle:timer, any:client)
|
||||||
new health = GetClientHealth(client);
|
new health = GetClientHealth(client);
|
||||||
health += ClientHealthRegenAmount[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.
|
// Check if the health points is below the limit.
|
||||||
if (health < ClientHealthRegenMax[client])
|
if (health <= ClientHealthRegenMax[client])
|
||||||
{
|
{
|
||||||
// Increase health.
|
// Increase health.
|
||||||
SetEntityHealth(client, health);
|
SetEntityHealth(client, health);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user