From 8e70c070c1be102a679ff3fd6f71669c883ec510 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Fri, 28 Sep 2018 22:27:08 +0200 Subject: [PATCH] Fix route programming lock-placement --- advtrains_interlocking/route_prog.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/advtrains_interlocking/route_prog.lua b/advtrains_interlocking/route_prog.lua index 0283bf5..33be576 100644 --- a/advtrains_interlocking/route_prog.lua +++ b/advtrains_interlocking/route_prog.lua @@ -258,16 +258,12 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing) advtrains.interlocking.visualize_route(rp.origin, rp.route, "prog_"..pname, rp.tmp_lcks, pname) return end - local ndef = minetest.registered_nodes[node.name] - if ndef and ndef.luaautomation and ndef.luaautomation.getstate then + if advtrains.is_passive(pos) then local pts = advtrains.roundfloorpts(pos) if rp.tmp_lcks[pts] then clear_lock(rp.tmp_lcks, pname, pts) else - local state = ndef.luaautomation.getstate - if type(state)=="function" then - state = state(pos, node) - end + local state = advtrains.getstate(pos) rp.tmp_lcks[pts] = state chat(pname, pts.." is held in "..state.." position when this route is set and freed ") end