From 050be27a3b1d90a7ac5f0bffafd8319f520b58e3 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 7 Jul 2014 10:39:21 +0200 Subject: Add stresstest example use globalstep less often --- init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index a8159c5..188fc58 100644 --- a/init.lua +++ b/init.lua @@ -234,7 +234,14 @@ minetest.register_on_joinplayer(function(player) end end) -minetest.register_globalstep(function() +playereffects.globalstep_timer = 0 +minetest.register_globalstep(function(dtime) + playereffects.globalstep_timer = playereffects.globalstep_timer + dtime + if(playereffects.globalstep_timer < 1) then + return + end + playereffects.globalstep_timer = 0 + local players = minetest.get_connected_players() for p=1,#players do playereffects.hud_update(players[p]) -- cgit v1.2.3