Fix a bug (in some cases the output rules of a receptor weren't respected, bug introduced by commit before, 64d109b31b)

This commit is contained in:
Jeija 2012-12-03 18:59:34 +01:00
parent 64d109b31b
commit 7542dd4da0

View File

@ -2,7 +2,7 @@
--Receptors --Receptors
function mesecon:is_receptor_node(nodename) function mesecon:is_receptor_node(nodename)
for i, receptor in ipairs(mesecon.receptors) do for _, receptor in ipairs(mesecon.receptors) do
if receptor.onstate == nodename then if receptor.onstate == nodename then
return true return true
end end
@ -11,7 +11,7 @@ function mesecon:is_receptor_node(nodename)
end end
function mesecon:is_receptor_node_off(nodename, pos, ownpos) function mesecon:is_receptor_node_off(nodename, pos, ownpos)
for i, receptor in ipairs(mesecon.receptors) do for _, receptor in ipairs(mesecon.receptors) do
if receptor.offstate == nodename then if receptor.offstate == nodename then
return true return true
end end
@ -248,12 +248,6 @@ function mesecon:connected_to_pw_src(pos, checked)
local node = minetest.env:get_node_or_nil(pos) local node = minetest.env:get_node_or_nil(pos)
if node == nil then return false, checked end if node == nil then return false, checked end
if mesecon:is_receptor_node(node.name) then
return true, checked
end
if mesecon:is_receptor_node_off(node.name) then
return true, checked
end
if mesecon:is_powered_by_receptor(pos) then --return if conductor is powered if mesecon:is_powered_by_receptor(pos) then --return if conductor is powered
return true, checked return true, checked
end end