Fix fence gate sounds being heard globally

This commit is contained in:
Wuzzy 2017-07-23 22:25:25 +02:00
parent 3584995293
commit 6577af3f11

View file

@ -100,11 +100,11 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups,
local tmp_node2
if state2 == 1 then
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}
else
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}
end
update_gate(pos, tmp_node2)