1
0
mirror of https://codeberg.org/tenplus1/ambience.git synced 2024-12-26 18:50:29 +01:00

only reset if handlers match

This commit is contained in:
tenplus1 2021-06-10 07:15:08 +01:00
parent 0b7b1fd27d
commit 01ebd210df

View File

@ -252,12 +252,15 @@ minetest.register_globalstep(function(dtime)
-- set timer to stop sound
minetest.after(ambience.length, function()
--print("-- timed stop after", set_name, handler, player_name)
--print("-- timed stop", set_name, handler)
minetest.sound_stop(handler)
-- make sure player still around and reset variables
if playing[player_name] then
-- reset variables if handlers match
if playing[player_name]
and playing[player_name].handler == handler then
--print("-- timed reset", handler, player_name)
playing[player_name].set = nil
playing[player_name].gain = nil