mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-11 18:40:25 +01:00
[inventory_icon] Use minetest.after (already-used 1s delay)
This commit is contained in:
parent
a6faed9f94
commit
f94ecd5fd8
@ -91,10 +91,8 @@ minetest.register_on_leaveplayer(function(player)
|
||||
inventory_icon.hudids[player:get_player_name()] = nil
|
||||
end)
|
||||
|
||||
inventory_icon.timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
inventory_icon.timer = inventory_icon.timer + dtime
|
||||
if inventory_icon.timer > 1 then
|
||||
local function tick()
|
||||
minetest.after(1, tick)
|
||||
for playername,hudids in pairs(inventory_icon.hudids) do
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "main")
|
||||
@ -133,6 +131,6 @@ minetest.register_globalstep(function(dtime)
|
||||
end
|
||||
end
|
||||
end
|
||||
inventory_icon.timer = 0
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
tick()
|
||||
|
Loading…
Reference in New Issue
Block a user