summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-09-17 19:30:03 +0200
committerGitHub <noreply@github.com>2020-09-17 19:30:03 +0200
commitfedbf4937224c79d49bb5077b47ebf53c38c9832 (patch)
treea96172d7682316767bc86b1da3c36f9223189760
parent9fda51b650c83aea82616055ae8814a722353bf4 (diff)
downloadmesecons-fedbf4937224c79d49bb5077b47ebf53c38c9832.tar
mesecons-fedbf4937224c79d49bb5077b47ebf53c38c9832.tar.gz
mesecons-fedbf4937224c79d49bb5077b47ebf53c38c9832.tar.bz2
mesecons-fedbf4937224c79d49bb5077b47ebf53c38c9832.tar.xz
mesecons-fedbf4937224c79d49bb5077b47ebf53c38c9832.zip
Noteblock: Fade out fire sound (#527)
-rw-r--r--mesecons_noteblock/init.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesecons_noteblock/init.lua b/mesecons_noteblock/init.lua
index b4e7d24..d29ab88 100644
--- a/mesecons_noteblock/init.lua
+++ b/mesecons_noteblock/init.lua
@@ -81,5 +81,11 @@ mesecon.noteblock_play = function(pos, param2)
end
end
pos.y = pos.y+1
- minetest.sound_play(soundname, { pos = pos }, true)
+ if soundname == "fire_fire" then
+ -- Smoothly fade out fire sound
+ local handle = minetest.sound_play(soundname, {pos = pos, loop = true})
+ minetest.after(3.0, minetest.sound_fade, handle, -1.5, 0.0)
+ else
+ minetest.sound_play(soundname, {pos = pos}, true)
+ end
end