1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 04:40:22 +02:00

Convert minetest.sound_play uses to ephemeral

This commit is contained in:
sfan5
2020-01-25 23:45:09 +01:00
parent 176ddba176
commit d3e26dba18
9 changed files with 28 additions and 22 deletions

View File

@ -46,7 +46,8 @@ function default.chest.chest_lid_close(pn)
local node = minetest.get_node(pos)
minetest.after(0.2, minetest.swap_node, pos, { name = "default:" .. swap,
param2 = node.param2 })
minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10})
minetest.sound_play(sound, {gain = 0.3, pos = pos,
max_hear_distance = 10}, true)
end
default.chest.open_chests = {}
@ -128,7 +129,7 @@ function default.chest.register_chest(name, d)
end
minetest.sound_play(def.sound_open, {gain = 0.3,
pos = pos, max_hear_distance = 10})
pos = pos, max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
minetest.swap_node(pos,
{ name = "default:" .. name .. "_open",
@ -199,7 +200,7 @@ function default.chest.register_chest(name, d)
end
def.on_rightclick = function(pos, node, clicker)
minetest.sound_play(def.sound_open, {gain = 0.3, pos = pos,
max_hear_distance = 10})
max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
minetest.swap_node(pos, {
name = "default:" .. name .. "_open",

View File

@ -141,7 +141,7 @@ default.cool_lava = function(pos, node)
minetest.set_node(pos, {name = "default:stone"})
end
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
{pos = pos, max_hear_distance = 16, gain = 0.25}, true)
end
if minetest.settings:get_bool("enable_lavacooling") ~= false then

View File

@ -20,7 +20,7 @@ local item = {
minetest.sound_play("default_item_smoke", {
pos = p,
max_hear_distance = 8,
})
}, true)
minetest.add_particlespawner({
amount = 3,
time = 0.1,

View File

@ -11,7 +11,8 @@ local function on_flood(pos, oldnode, newnode)
nodedef.groups.igniter and nodedef.groups.igniter > 0) then
minetest.sound_play(
"default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.1}
{pos = pos, max_hear_distance = 16, gain = 0.1},
true
)
end
-- Remove the torch node