aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-09-28 22:27:08 +0200
committerorwell96 <orwell@bleipb.de>2018-09-28 22:27:08 +0200
commit8e70c070c1be102a679ff3fd6f71669c883ec510 (patch)
treed148508adbcf2f164752cabae35ad58108ed9517 /advtrains_interlocking
parent07ecc44130d7aa63de6c366934cd8f7c917dbecf (diff)
downloadadvtrains-8e70c070c1be102a679ff3fd6f71669c883ec510.tar.gz
advtrains-8e70c070c1be102a679ff3fd6f71669c883ec510.tar.bz2
advtrains-8e70c070c1be102a679ff3fd6f71669c883ec510.zip
Fix route programming lock-placement
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r--advtrains_interlocking/route_prog.lua8
1 files 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