From 01952b56fdaf70ecc3659fb176021a711f19bfcd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 22 Jan 2018 16:53:44 +0100 Subject: [PATCH] Fix bad repeater updates when next to opaque block --- mods/ITEMS/REDSTONE/mesecons/internal.lua | 10 ++++++++-- mods/ITEMS/REDSTONE/mesecons/services.lua | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons/internal.lua b/mods/ITEMS/REDSTONE/mesecons/internal.lua index 6c4eb91e..b1eead32 100644 --- a/mods/ITEMS/REDSTONE/mesecons/internal.lua +++ b/mods/ITEMS/REDSTONE/mesecons/internal.lua @@ -482,8 +482,14 @@ function mesecon.turnoff(pos, link) -- Warning: A LOT of nodes need to be looked at for this to work for _, r in ipairs(mesecon.rule2meta(f.link, mesecon.rules.mcl_alldirs_spread)) do local np = vector.add(f.pos, r) - if mesecon.is_receptor_on(mesecon.get_node_force(np).name) then - return false + local n = mesecon.get_node_force(np) + if mesecon.is_receptor_on(n.name) then + local receptorrules = mesecon.receptor_get_rules(n) + for _, rr in pairs(receptorrules) do + if vector.equals(mesecon.invertRule(rr), r) then + return false + end + end end for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do local nlink = table.copy(l) diff --git a/mods/ITEMS/REDSTONE/mesecons/services.lua b/mods/ITEMS/REDSTONE/mesecons/services.lua index f7be0a5b..9de9cb46 100644 --- a/mods/ITEMS/REDSTONE/mesecons/services.lua +++ b/mods/ITEMS/REDSTONE/mesecons/services.lua @@ -84,7 +84,7 @@ mesecon.on_dignode = function(pos, node) local nnode = minetest.get_node(npos) if mesecon.is_conductor_on(nnode) then mesecon.receptor_off(npos, mesecon.conductor_get_rules(nnode)) - elseif mesecon.is_effector_on(nnode.name) then + elseif mesecon.is_effector_on(nnode.name) and mesecon.is_powered(npos) == false then mesecon.changesignal(npos, nnode, nlink, mesecon.state.off, 1) mesecon.deactivate(npos, nnode, nlink, 1) end