From f11201274737609f148dd1b1fcd46d35d96eb850 Mon Sep 17 00:00:00 2001 From: Wouters Dorian Date: Fri, 31 Jul 2015 15:12:46 +0200 Subject: [PATCH] [areas] Reduce HUD tick rate to 1s --- mods/areas/hud.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/areas/hud.lua b/mods/areas/hud.lua index b31742b0..e1f6c1fa 100755 --- a/mods/areas/hud.lua +++ b/mods/areas/hud.lua @@ -2,7 +2,8 @@ areas.hud = {} -minetest.register_globalstep(function(dtime) +local function tick() + minetest.after(1, tick) for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local pos = vector.round(player:getpos()) @@ -38,7 +39,9 @@ minetest.register_globalstep(function(dtime) hud.oldAreas = areaString end end -end) +end + +tick() minetest.register_on_leaveplayer(function(player) areas.hud[player:get_player_name()] = nil