mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-09 17:23:49 +01:00
Fix bad repeater updates when next to opaque block
This commit is contained in:
parent
f4657f79f5
commit
01952b56fd
@ -482,9 +482,15 @@ function mesecon.turnoff(pos, link)
|
|||||||
-- Warning: A LOT of nodes need to be looked at for this to work
|
-- 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
|
for _, r in ipairs(mesecon.rule2meta(f.link, mesecon.rules.mcl_alldirs_spread)) do
|
||||||
local np = vector.add(f.pos, r)
|
local np = vector.add(f.pos, r)
|
||||||
if mesecon.is_receptor_on(mesecon.get_node_force(np).name) then
|
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
|
return false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do
|
for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do
|
||||||
local nlink = table.copy(l)
|
local nlink = table.copy(l)
|
||||||
nlink.spread = false
|
nlink.spread = false
|
||||||
|
@ -84,7 +84,7 @@ mesecon.on_dignode = function(pos, node)
|
|||||||
local nnode = minetest.get_node(npos)
|
local nnode = minetest.get_node(npos)
|
||||||
if mesecon.is_conductor_on(nnode) then
|
if mesecon.is_conductor_on(nnode) then
|
||||||
mesecon.receptor_off(npos, mesecon.conductor_get_rules(nnode))
|
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.changesignal(npos, nnode, nlink, mesecon.state.off, 1)
|
||||||
mesecon.deactivate(npos, nnode, nlink, 1)
|
mesecon.deactivate(npos, nnode, nlink, 1)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user