mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-22 04:42:23 +01:00
Limit recalculations.
Setting based - limit area recalculation and allow tuning of the interval.
This commit is contained in:
parent
1bbb997c7a
commit
7b51f84404
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())
|
||||
|
@ -40,3 +40,6 @@ setting("number", "self_protection_max_areas_high", 32)
|
||||
|
||||
-- legacy_table (owner_defs) compatibility. Untested and has known issues.
|
||||
setting("boolean", "legacy_table", false)
|
||||
|
||||
-- configure the refresh delay for the name displays in the HUD
|
||||
setting("number", "tick", 0.5)
|
||||
|
Loading…
Reference in New Issue
Block a user