aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authorBlockhead <jbis1337@hotmail.com>2020-11-01 17:34:13 +1100
committerorwell96 <orwell@bleipb.de>2020-11-02 12:12:41 +0100
commit8d58bd51cd1a48b6e82b75a1452f8a0b8ed9f6cb (patch)
treea5e0c329eee8a830beebc7a182da630ef9af221e /advtrains
parentb616ae4425b26d0163e9d5f5cb98121fa103e003 (diff)
Workaround to destroy looping sounds
Needed for linetrack boat sound bug
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/wagons.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 5564fa5..ad4a5ab 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -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
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
-- atomic.lua
-- Utilities for transaction-like handling of serialized state files
-- Also for multiple files that must be synchronous, as advtrains currently requires.


-- Managing files and backups