From 7542dd4da088ddadfb4a4e9a0a93a16e35f11469 Mon Sep 17 00:00:00 2001 From: Jeija Date: Mon, 3 Dec 2012 18:59:34 +0100 Subject: [PATCH] Fix a bug (in some cases the output rules of a receptor weren't respected, bug introduced by commit before, 64d109b31b) --- mesecons/internal.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mesecons/internal.lua b/mesecons/internal.lua index e45fe4e..7a576d6 100644 --- a/mesecons/internal.lua +++ b/mesecons/internal.lua @@ -2,7 +2,7 @@ --Receptors 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 return true end @@ -11,7 +11,7 @@ function mesecon:is_receptor_node(nodename) end 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 return true end @@ -248,12 +248,6 @@ function mesecon:connected_to_pw_src(pos, checked) local node = minetest.env:get_node_or_nil(pos) 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 return true, checked end