fix energy and magic replenishing bug

pull/2/head
Brandon 2014-05-16 18:16:07 -05:00
parent e55b51043e
commit ccb41016be
1 changed files with 12 additions and 10 deletions

View File

@ -322,7 +322,18 @@ minetest.after(2.5, function()
local name = player:get_player_name()
local immortal = minetest.check_player_privs(name, {immortal=true})
-- 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 hp = player:get_hp()
if HUD_ENABLE_HUNGER and timer > 4 then
@ -345,15 +356,6 @@ minetest.after(2.5, function()
-- update current armor level
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_hud(player)
end