Workaround to destroy looping sounds

Needed for linetrack boat sound bug
This commit is contained in:
Blockhead 2020-11-01 17:34:13 +11:00 committed by orwell96
parent b616ae4425
commit 8d58bd51cd
1 changed files with 4 additions and 0 deletions

View File

@ -527,6 +527,10 @@ function wagon:on_step(dtime)
if not players_in then
if advtrains.outside_range(pos) then
--atdebug("wagon",self.id,"unloading (too far away)")
-- Workaround until minetest engine deletes attached sounds
if self.sound_loop_handle then
minetest.sound_stop(self.sound_loop_handle)
end
self.object:remove()
end
end