1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-05 10:00:26 +01:00

if door is double, only 1 door play a sound (open|close)

remove debug comment
This commit is contained in:
crabman77 2016-01-09 21:00:40 +01:00
parent ce9c1d19d6
commit 43bfae145b

View File

@ -28,19 +28,19 @@ function doors3.get_pos(pos, dir, p1, b)
else
if p1 == 1 then
if dir == 1 then
pos2.x=pos2.x+1--ok
pos2.x=pos2.x+1
elseif dir == 2 then
pos2.z=pos2.z-1
elseif dir == 3 then
pos2.x=pos2.x-1
else
pos2.z=pos2.z+1--ok
pos2.z=pos2.z+1
end
else
if dir == 1 then
pos2.z=pos2.z+1
elseif dir == 2 then
pos2.x=pos2.x+1--ok
pos2.x=pos2.x+1
elseif dir == 3 then
pos2.z=pos2.z-1
else
@ -246,11 +246,6 @@ function doors3.register_door(name, def)
snd_2 = def.sound_close_door
end
local b = minetest.get_meta(pos):get_int("right")
if b ~= 0 then
minetest.sound_play(snd_1, {pos = pos, gain = 0.3, max_hear_distance = 10})
else
minetest.sound_play(snd_2, {pos = pos, gain = 0.3, max_hear_distance = 10})
end
local pos2 = doors3.get_pos(pos, oldparam2, params[1], b)
local node = minetest.get_node_or_nil(pos2)
@ -261,6 +256,13 @@ function doors3.register_door(name, def)
end
end
end
--if double doors, only 2eme play sound
if b ~= 0 then
minetest.sound_play(snd_1, {pos = pos, gain = 0.3, max_hear_distance = 10})
else
minetest.sound_play(snd_2, {pos = pos, gain = 0.3, max_hear_distance = 10})
end
end