mirror of
https://codeberg.org/tenplus1/ambience.git
synced 2024-12-28 03:30:28 +01:00
fix player disconnect in minetest.after
This commit is contained in:
parent
f4e73d592e
commit
bffbb1c822
7
init.lua
7
init.lua
@ -206,10 +206,10 @@ minetest.register_globalstep(function(dtime)
|
|||||||
|
|
||||||
--print(string.format("elapsed time: %.4f\n", os.clock() - t1))
|
--print(string.format("elapsed time: %.4f\n", os.clock() - t1))
|
||||||
|
|
||||||
ok = true -- everything starts off ok
|
ok = playing[player_name] -- everything starts off ok if player around
|
||||||
|
|
||||||
-- are we playing something already?
|
-- are we playing something already?
|
||||||
if playing[player_name].handler then
|
if ok and playing[player_name].handler then
|
||||||
|
|
||||||
-- stop current sound if another set active or gain changed
|
-- stop current sound if another set active or gain changed
|
||||||
if playing[player_name].set ~= set_name
|
if playing[player_name].set ~= set_name
|
||||||
@ -263,7 +263,8 @@ minetest.register_globalstep(function(dtime)
|
|||||||
--print("-- after", set_name, handler)
|
--print("-- after", set_name, handler)
|
||||||
|
|
||||||
-- make sure we are stopping same sound we started
|
-- make sure we are stopping same sound we started
|
||||||
if playing[player_name].handler
|
if playing[player_name]
|
||||||
|
and playing[player_name].handler
|
||||||
and playing[player_name].handler == handler then
|
and playing[player_name].handler == handler then
|
||||||
|
|
||||||
--print("-- timed stop", set_name, handler)
|
--print("-- timed stop", set_name, handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user