This repository was archived by the owner on Aug 20, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -94,15 +94,11 @@ minetest.register_on_respawnplayer(function(player)
9494 hbhunger .exhaustion [name ] = 0
9595end )
9696
97- local main_timer = 0
9897local timer = 0
9998local timer2 = 0
100- minetest .register_globalstep (function (dtime )
101- main_timer = main_timer + dtime
102- timer = timer + dtime
103- timer2 = timer2 + dtime
104- if main_timer > HUNGER_HUD_TICK or timer > 10 or timer2 > HUNGER_HUNGER_TICK then
105- if main_timer > HUNGER_HUD_TICK then main_timer = 0 end
99+ local function hunger_step ()
100+ timer = timer + HUNGER_HUD_TICK
101+ timer2 = timer2 + HUNGER_HUD_TICK
106102 for _ ,player in ipairs (minetest .get_connected_players ()) do
107103 local name = player :get_player_name ()
108104
@@ -144,9 +140,11 @@ minetest.register_globalstep(function(dtime)
144140 hbhunger .handle_node_actions (nil , nil , player )
145141 end
146142 end
147- end
143+ -- end
148144 if timer > 10 then timer = 0 end
149145 if timer2 > HUNGER_HUNGER_TICK then timer2 = 0 end
150- end )
146+ minetest .after (HUNGER_HUD_TICK , hunger_step )
147+ end
148+ minetest .after (0 , hunger_step )
151149
152150end
You can’t perform that action at this time.
0 commit comments