1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-08 03:20:21 +01:00

[sprint] Fix method name and stamina HUD bar max_value change

This commit is contained in:
Wouters Dorian 2015-07-31 21:46:31 +02:00
parent 793aac3a3a
commit fbfc43fc63

View File

@ -17,6 +17,7 @@ sprint.set_maxstamina = function(pname, mstamina)
if sprint.players[pname].stamina > sprint.players[pname].maxStamina then
sprint.players[pname].stamina = sprint.players[pname].maxStamina
end
hb.change_hudbar(minetest.get_player_by_name(pname), "sprint", sprint.players[pname].stamina, sprint.players[pname].maxStamina)
end
end
@ -33,21 +34,19 @@ sprint.increase_maxstamina = function(pname, sincrease)
end
end
sprint.dicrease_maxstamina = function(pname, sdicrease)
sprint.decrease_maxstamina = function(pname, sdicrease)
local stamina = sprint.get_maxstamina(pname)
if stamina then
sprint.set_maxstamina(pname, stamina - sdicrease)
end
end
-- When you write shit english, don't write shit code.
-- Writing it in your native language would be less of a pain.
-- - gravgun
sprint.dicrease_maxstamina = sprint.decrease_maxstamina
sprint.set_default_maxstamina = function(pname)
if sprint.players[pname] then
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
sprint.set_maxstamina(pname, SPRINT_STAMINA)
end