Skip to content

Commit fedbf49

Browse files
authored
Noteblock: Fade out fire sound (#527)
1 parent 9fda51b commit fedbf49

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mesecons_noteblock/init.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,11 @@ mesecon.noteblock_play = function(pos, param2)
8181
end
8282
end
8383
pos.y = pos.y+1
84-
minetest.sound_play(soundname, { pos = pos }, true)
84+
if soundname == "fire_fire" then
85+
-- Smoothly fade out fire sound
86+
local handle = minetest.sound_play(soundname, {pos = pos, loop = true})
87+
minetest.after(3.0, minetest.sound_fade, handle, -1.5, 0.0)
88+
else
89+
minetest.sound_play(soundname, {pos = pos}, true)
90+
end
8591
end

0 commit comments

Comments
 (0)