forked from minetest-mods/mesecons
**This commit changes functionality**, please read
Remove legacy code that enabled / disabled mesecon wires that were placed 2 blocks below a pressure plate. From now on, please place a vertical wire at that place. That way, no false signals will be triggered (the wire won't "flash" turned off if you enable it by a pressure plate and turn off a switch connected to it). If you depend on this functionality, please just revert this commit. That should be possible in the near future as well, since no major rewrites are planned for mesecons_pressureplates. In the long run, please update your mesecon strucutres to use vertical wires instead of relying on this old hack.
This commit is contained in:
parent
dca4706c7f
commit
adb803ce17
@ -22,18 +22,12 @@ pp_on_timer = function (pos, elapsed)
|
|||||||
if objs[1] == nil and node.name == basename .. "_on" then
|
if objs[1] == nil and node.name == basename .. "_on" then
|
||||||
minetest.add_node(pos, {name = basename .. "_off"})
|
minetest.add_node(pos, {name = basename .. "_off"})
|
||||||
mesecon.receptor_off(pos, mesecon.rules.pplate)
|
mesecon.receptor_off(pos, mesecon.rules.pplate)
|
||||||
-- force deactivation of mesecon two blocks below (hacky)
|
|
||||||
if not mesecon.connected_to_receptor(two_below) then
|
|
||||||
mesecon.turnoff(two_below)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
local objpos = obj:getpos()
|
local objpos = obj:getpos()
|
||||||
if objpos.y > pos.y-1 and objpos.y < pos.y then
|
if objpos.y > pos.y-1 and objpos.y < pos.y then
|
||||||
minetest.add_node(pos, {name = basename .. "_on"})
|
minetest.add_node(pos, {name = basename .. "_on"})
|
||||||
mesecon.receptor_on(pos, mesecon.rules.pplate )
|
mesecon.receptor_on(pos, mesecon.rules.pplate )
|
||||||
-- force activation of mesecon two blocks below (hacky)
|
|
||||||
mesecon.turnon(two_below)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user