Minor refactoring

This commit is contained in:
Wuzzy 2015-02-24 00:50:03 +01:00
parent 02db771b42
commit fbdadb09e2

View File

@ -97,7 +97,6 @@ end)
local main_timer = 0
local timer = 0
local timer2 = 0
minetest.after(2.5, function()
minetest.register_globalstep(function(dtime)
main_timer = main_timer + dtime
timer = timer + dtime
@ -107,7 +106,6 @@ minetest.after(2.5, function()
for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
-- only proceed if damage is enabled
local h = tonumber(hunger.hunger[name])
local hp = player:get_hp()
if timer > 4 then
@ -137,11 +135,9 @@ minetest.after(2.5, function()
hunger.handle_node_actions(nil, nil, player)
end
end
end
if timer > 4 then timer = 0 end
if timer2 > HUNGER_HUNGER_TICK then timer2 = 0 end
end)
end)
end