forked from MineClone5/MineClone5
Fix fence gate sounds being heard globally
This commit is contained in:
parent
3584995293
commit
6577af3f11
|
@ -100,11 +100,11 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups,
|
||||||
local tmp_node2
|
local tmp_node2
|
||||||
if state2 == 1 then
|
if state2 == 1 then
|
||||||
state2 = 0
|
state2 = 0
|
||||||
minetest.sound_play(sound_close, {gain = sound_gain_close, max_hear_distance = 10})
|
minetest.sound_play(sound_close, {gain = sound_gain_close, max_hear_distance = 10, pos = pos})
|
||||||
tmp_node2 = {name=gate_id, param1=node.param1, param2=node.param2}
|
tmp_node2 = {name=gate_id, param1=node.param1, param2=node.param2}
|
||||||
else
|
else
|
||||||
state2 = 1
|
state2 = 1
|
||||||
minetest.sound_play(sound_open, {gain = sound_gain_open, max_hear_distance = 10})
|
minetest.sound_play(sound_open, {gain = sound_gain_open, max_hear_distance = 10, pos = pos})
|
||||||
tmp_node2 = {name=open_gate_id, param1=node.param1, param2=node.param2}
|
tmp_node2 = {name=open_gate_id, param1=node.param1, param2=node.param2}
|
||||||
end
|
end
|
||||||
update_gate(pos, tmp_node2)
|
update_gate(pos, tmp_node2)
|
||||||
|
|
Loading…
Reference in New Issue