diff options
author | sfan5 <sfan5@live.de> | 2020-01-25 21:57:29 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-02-01 20:31:41 +0100 |
commit | 7d29611c1b619b6a336fc0505d993fbe539a62b9 (patch) | |
tree | 3d8d7e6174e3393bb04575cf11cebc513b88c774 /builtin | |
parent | c10e188594d445c724de6b11fd70590bbe6b57d7 (diff) | |
download | minetest-7d29611c1b619b6a336fc0505d993fbe539a62b9.tar.gz minetest-7d29611c1b619b6a336fc0505d993fbe539a62b9.tar.bz2 minetest-7d29611c1b619b6a336fc0505d993fbe539a62b9.zip |
Convert sound_play uses in builtin to ephemeral
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/falling.lua | 6 | ||||
-rw-r--r-- | builtin/game/item.lua | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 950d6b56f..4dd60de05 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -128,7 +128,7 @@ core.register_entity(":__builtin:falling_node", { meta:from_table(self.meta) end if def.sounds and def.sounds.place then - core.sound_play(def.sounds.place, {pos = np}) + core.sound_play(def.sounds.place, {pos = np}, true) end end self.object:remove() @@ -154,7 +154,7 @@ local function convert_to_falling_node(pos, node) local def = core.registered_nodes[node.name] if def and def.sounds and def.sounds.fall then - core.sound_play(def.sounds.fall, {pos = pos}) + core.sound_play(def.sounds.fall, {pos = pos}, true) end obj:get_luaentity():set_node(node, metatable) @@ -187,7 +187,7 @@ local function drop_attached_node(p) def.preserve_metadata(pos_copy, node_copy, oldmeta, drops) end if def and def.sounds and def.sounds.fall then - core.sound_play(def.sounds.fall, {pos = p}) + core.sound_play(def.sounds.fall, {pos = p}, true) end core.remove_node(p) for _, item in pairs(drops) do diff --git a/builtin/game/item.lua b/builtin/game/item.lua index 3958cb66f..cc221b3f5 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -475,7 +475,10 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed user:set_hp(user:get_hp() + hp_change) if def and def.sound and def.sound.eat then - minetest.sound_play(def.sound.eat, { pos = user:get_pos(), max_hear_distance = 16 }) + core.sound_play(def.sound.eat, { + pos = user:get_pos(), + max_hear_distance = 16 + }, true) end if replace_with_item then @@ -582,7 +585,10 @@ function core.node_dig(pos, node, digger) if not core.settings:get_bool("creative_mode") then wielded:add_wear(dp.wear) if wielded:get_count() == 0 and wdef.sound and wdef.sound.breaks then - core.sound_play(wdef.sound.breaks, {pos = pos, gain = 0.5}) + core.sound_play(wdef.sound.breaks, { + pos = pos, + gain = 0.5 + }, true) end end end |