mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 00:20:17 +01:00
Added sounds to doors and gates
This commit is contained in:
parent
9dd2b5763c
commit
0a0cf536a3
@ -276,10 +276,22 @@ function homedecor_flip_door(pos, node, player, name, side)
|
|||||||
rside = "right"
|
rside = "right"
|
||||||
nfdir=node.param2 - 1
|
nfdir=node.param2 - 1
|
||||||
if nfdir < 0 then nfdir = 3 end
|
if nfdir < 0 then nfdir = 3 end
|
||||||
|
minetest.sound_play({
|
||||||
|
name="homedecor_door_open",
|
||||||
|
pos=pos,
|
||||||
|
max_hear_distance = 10,
|
||||||
|
gain = 2
|
||||||
|
})
|
||||||
else
|
else
|
||||||
rside = "left"
|
rside = "left"
|
||||||
nfdir=node.param2 + 1
|
nfdir=node.param2 + 1
|
||||||
if nfdir > 3 then nfdir = 0 end
|
if nfdir > 3 then nfdir = 0 end
|
||||||
|
minetest.sound_play({
|
||||||
|
name="homedecor_door_close",
|
||||||
|
pos=pos,
|
||||||
|
max_hear_distance = 10,
|
||||||
|
gain = 2
|
||||||
|
})
|
||||||
end
|
end
|
||||||
minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_"..name.."_top_"..rside, param2=nfdir})
|
minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_"..name.."_top_"..rside, param2=nfdir})
|
||||||
minetest.env:add_node(pos, { name = "homedecor:door_"..name.."_bottom_"..rside, param2=nfdir})
|
minetest.env:add_node(pos, { name = "homedecor:door_"..name.."_bottom_"..rside, param2=nfdir})
|
||||||
@ -293,4 +305,11 @@ function homedecor_flip_gate(pos, node, player, gate, oc)
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(pos, { name = "homedecor:gate_"..gate.."_closed", param2=fdir})
|
minetest.env:add_node(pos, { name = "homedecor:gate_"..gate.."_closed", param2=fdir})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.sound_play({
|
||||||
|
name="homedecor_gate_open_close",
|
||||||
|
pos=pos,
|
||||||
|
max_hear_distance = 10,
|
||||||
|
gain = 2
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
BIN
sounds/homedecor_door_close.ogg
Normal file
BIN
sounds/homedecor_door_close.ogg
Normal file
Binary file not shown.
BIN
sounds/homedecor_door_open.ogg
Normal file
BIN
sounds/homedecor_door_open.ogg
Normal file
Binary file not shown.
BIN
sounds/homedecor_gate_open_close.ogg
Normal file
BIN
sounds/homedecor_gate_open_close.ogg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user