forked from minetest-mods/areas
Limit recalculations.
Setting based - limit area recalculation and allow tuning of the interval.
This commit is contained in:
9
hud.lua
9
hud.lua
@ -1,8 +1,17 @@
|
||||
-- This is inspired by the landrush mod by Bremaweb
|
||||
|
||||
areas.hud = {}
|
||||
areas.hud.refresh = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
|
||||
areas.hud.refresh = areas.hud.refresh + dtime
|
||||
if areas.hud.refresh > areas.config["tick"] then
|
||||
areas.hud.refresh = 0
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local pos = vector.round(player:getpos())
|
||||
|
Reference in New Issue
Block a user