mirror of
https://notabug.org/TenPlus1/protector.git
synced 2025-01-08 11:57:28 +01:00
0.4.16+ tidy
This commit is contained in:
parent
a7ee92feff
commit
52db28ccdd
8
hud.lua
8
hud.lua
@ -6,6 +6,7 @@ local hud_timer = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
|
||||
-- every 5 seconds
|
||||
hud_timer = hud_timer + dtime
|
||||
if hud_timer < 5 then
|
||||
return
|
||||
@ -15,12 +16,12 @@ minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
|
||||
local name = player:get_player_name()
|
||||
local pos = vector.round(player:getpos())
|
||||
local pos = vector.round(player:get_pos())
|
||||
local hud_text = ""
|
||||
|
||||
local protectors = minetest.find_nodes_in_area(
|
||||
{x=pos.x -radius , y=pos.y -radius , z=pos.z -radius},
|
||||
{x=pos.x +radius , y=pos.y +radius , z=pos.z +radius},
|
||||
{x = pos.x - radius , y = pos.y - radius , z = pos.z - radius},
|
||||
{x = pos.x + radius , y = pos.y + radius , z = pos.z + radius},
|
||||
{"protector:protect","protector:protect2"})
|
||||
|
||||
if #protectors > 0 then
|
||||
@ -58,4 +59,3 @@ end)
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
hud[player:get_player_name()] = nil
|
||||
end)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user