mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-07 06:06:10 -04:00
TNT: Allow a custom explosion sound to be used
This commit is contained in:
parent
20687a6301
commit
bb084294ce
2 changed files with 4 additions and 1 deletions
|
@ -384,7 +384,9 @@ end
|
|||
function tnt.boom(pos, def)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||
local sound = def.sound or "tnt_explode"
|
||||
minetest.sound_play(sound, {pos = pos, gain = 1.5,
|
||||
max_hear_distance = math.min(def.radius * 20, 128)})
|
||||
minetest.set_node(pos, {name = "tnt:boom"})
|
||||
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection,
|
||||
def.ignore_on_blast, owner)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue