1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-08 19:40:21 +01:00

[areas] Reduce HUD tick rate to 1s

This commit is contained in:
Wouters Dorian 2015-07-31 15:12:46 +02:00
parent ca056b9920
commit f112012747

View File

@ -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