fix energy and magic replenishing bug
This commit is contained in:
parent
e55b51043e
commit
ccb41016be
@ -322,7 +322,18 @@ minetest.after(2.5, function()
|
|||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local immortal = minetest.check_player_privs(name, {immortal=true})
|
local immortal = minetest.check_player_privs(name, {immortal=true})
|
||||||
-- only proceed if damage is enabled
|
-- only proceed if damage is enabled
|
||||||
if minetest.setting_getbool("enable_damage") and not immortal then
|
if immortal == false then
|
||||||
|
if stamina_timer > HUD_STAMINA_TICK then
|
||||||
|
hud.update_stamina(player,name)
|
||||||
|
stamina_timer = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
if magic_timer > HUD_MAGIC_TICK then
|
||||||
|
magic.update_magic(player,name)
|
||||||
|
magic_timer = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if minetest.setting_getbool("enable_damage") and immortal == false then
|
||||||
local h = tonumber(hud.hunger[name])
|
local h = tonumber(hud.hunger[name])
|
||||||
local hp = player:get_hp()
|
local hp = player:get_hp()
|
||||||
if HUD_ENABLE_HUNGER and timer > 4 then
|
if HUD_ENABLE_HUNGER and timer > 4 then
|
||||||
@ -345,15 +356,6 @@ minetest.after(2.5, function()
|
|||||||
-- update current armor level
|
-- update current armor level
|
||||||
if HUD_SHOW_ARMOR then hud.get_armor(player) end
|
if HUD_SHOW_ARMOR then hud.get_armor(player) end
|
||||||
|
|
||||||
if stamina_timer > HUD_STAMINA_TICK then
|
|
||||||
hud.update_stamina(player,name)
|
|
||||||
stamina_timer = stamina_timer - HUD_STAMINA_TICK
|
|
||||||
end
|
|
||||||
|
|
||||||
if magic_timer > HUD_MAGIC_TICK then
|
|
||||||
magic.update_magic(player,name)
|
|
||||||
magic_timer = magic_timer - HUD_MAGIC_TICK
|
|
||||||
end
|
|
||||||
-- update all hud elements
|
-- update all hud elements
|
||||||
update_hud(player)
|
update_hud(player)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user