mirror of
https://github.com/mt-mods/spacesuit.git
synced 2026-05-04 13:56:51 -06:00
move player check out of globalstep code
This commit is contained in:
+10
-9
@@ -1,13 +1,5 @@
|
|||||||
|
|
||||||
|
local function check_player(player, timer)
|
||||||
|
|
||||||
local timer = 0
|
|
||||||
minetest.register_globalstep(function(dtime)
|
|
||||||
timer = timer + dtime;
|
|
||||||
if timer >= 1 then
|
|
||||||
local t0 = minetest.get_us_time()
|
|
||||||
|
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
|
||||||
local _, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]")
|
local _, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]")
|
||||||
|
|
||||||
local has_helmet = armor_inv:contains_item("armor", "spacesuit:helmet")
|
local has_helmet = armor_inv:contains_item("armor", "spacesuit:helmet")
|
||||||
@@ -54,7 +46,16 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local timer = 0
|
||||||
|
minetest.register_globalstep(function(dtime)
|
||||||
|
timer = timer + dtime;
|
||||||
|
if timer >= 1 then
|
||||||
|
local t0 = minetest.get_us_time()
|
||||||
|
|
||||||
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
|
check_player(player, timer)
|
||||||
end
|
end
|
||||||
timer = 0
|
timer = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user