mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
[ambience] Use minetest.after
This commit is contained in:
parent
1d5b2aac23
commit
ca056b9920
@ -738,14 +738,8 @@ local stop_sound = function(still_playing, player)
|
||||
|
||||
end
|
||||
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer+dtime
|
||||
if timer < 1 then
|
||||
return
|
||||
end
|
||||
timer = 0
|
||||
|
||||
local function tick()
|
||||
minetest.after(1, tick)
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
ambiences = get_ambience(player)
|
||||
stop_sound(ambiences, player)
|
||||
@ -773,8 +767,9 @@ minetest.register_globalstep(function(dtime)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
tick()
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local player_name = player:get_player_name()
|
||||
|
Loading…
Reference in New Issue
Block a user