diff options
author | Jeija <norrepli@gmail.com> | 2012-12-08 16:08:16 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2012-12-08 16:08:16 +0100 |
commit | f28cf0af035b7a4ee573059f1215f2998eb9dab0 (patch) | |
tree | 8562aa619adfef6360544ae9a167697db92565be | |
parent | 12206ac190375c2e3b360ad1b2a0b892b4544d7f (diff) | |
download | mesecons-f28cf0af035b7a4ee573059f1215f2998eb9dab0.tar mesecons-f28cf0af035b7a4ee573059f1215f2998eb9dab0.tar.gz mesecons-f28cf0af035b7a4ee573059f1215f2998eb9dab0.tar.bz2 mesecons-f28cf0af035b7a4ee573059f1215f2998eb9dab0.tar.xz mesecons-f28cf0af035b7a4ee573059f1215f2998eb9dab0.zip |
Fix major bug that often occured when using gates (caused by commit 64d109b)
-rw-r--r-- | mesecons/internal.lua | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/mesecons/internal.lua b/mesecons/internal.lua index 7a576d6..e197879 100644 --- a/mesecons/internal.lua +++ b/mesecons/internal.lua @@ -246,22 +246,17 @@ function mesecon:connected_to_pw_src(pos, checked) checked[c] = {x=pos.x, y=pos.y, z=pos.z} --add current node to checked local node = minetest.env:get_node_or_nil(pos) - if node == nil then return false, checked end + if not mesecon:is_conductor(node.name) then return false, checked end if mesecon:is_powered_by_receptor(pos) then --return if conductor is powered return true, checked end --Check if conductors around are connected - if mesecon:is_conductor(node.name) then - rules = mesecon:conductor_get_rules(node) - elseif mesecon:is_effector(node.name) then - rules = mesecon:effector_get_input_rules(node) - else - return false, checked - end + local connected + local rules = mesecon:conductor_get_rules(node) - for i, rule in ipairs(rules) do + for _, rule in ipairs(rules) do local np = {} np.x = pos.x + rule.x np.y = pos.y + rule.y |