corrected the syntax of the sound play commands for gates/doors

This commit is contained in:
Vanessa Ezekowitz 2013-06-09 20:02:07 -04:00
parent cf717ce73f
commit 333a74418f

View File

@ -305,21 +305,19 @@ 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({ minetest.sound_play("homedecor_door_open", {
name="homedecor_door_open",
pos=pos, pos=pos,
max_hear_distance = 5, max_hear_distance = 5,
gain = 1, 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({ minetest.sound_play("homedecor_door_close", {
name="homedecor_door_close",
pos=pos, pos=pos,
max_hear_distance = 5, max_hear_distance = 5,
gain = 1, 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})
@ -327,11 +325,10 @@ function homedecor_flip_door(pos, node, player, name, side)
end end
function homedecor_flip_gate(pos, node, player, gate, oc) function homedecor_flip_gate(pos, node, player, gate, oc)
minetest.sound_play({ minetest.sound_play("homedecor_gate_open_close", {
name="homedecor_gate_open_close",
pos=pos, pos=pos,
max_hear_distance = 5, max_hear_distance = 5,
gain = 1, gain = 2,
}) })
local fdir = node.param2 local fdir = node.param2