mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-17 07:50:29 +01:00
fixed error hudbars: stamina > maxStamina
This commit is contained in:
parent
8dae42cd3d
commit
fd5e56fe1e
|
@ -14,6 +14,9 @@ local staminaHud = {}
|
||||||
sprint.set_maxstamina = function(pname, mstamina)
|
sprint.set_maxstamina = function(pname, mstamina)
|
||||||
if sprint.players[pname] and mstamina > 0 then
|
if sprint.players[pname] and mstamina > 0 then
|
||||||
sprint.players[pname].maxStamina = mstamina
|
sprint.players[pname].maxStamina = mstamina
|
||||||
|
if sprint.players[pname].stamina > sprint.players[pname].maxStamina then
|
||||||
|
sprint.players[pname].stamina = sprint.players[pname].maxStamina
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -40,6 +43,10 @@ end
|
||||||
sprint.set_default_maxstamina = function(pname)
|
sprint.set_default_maxstamina = function(pname)
|
||||||
if sprint.players[pname] then
|
if sprint.players[pname] then
|
||||||
sprint.players[pname].maxStamina = SPRINT_STAMINA
|
sprint.players[pname].maxStamina = SPRINT_STAMINA
|
||||||
|
if sprint.players[pname].stamina > sprint.players[pname].maxStamina then
|
||||||
|
sprint.players[pname].stamina = sprint.players[pname].maxStamina
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user