aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/route_prog.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-11-25 22:31:26 +0100
committerorwell <orwell@bleipb.de>2024-11-25 22:31:26 +0100
commit922e654b7bef51c7ddaf510ec70880d48181dd35 (patch)
tree3d12820d7a67180df3d2bd36d3fa7b4d61c1166c /advtrains_interlocking/route_prog.lua
parent73c393e223b1d2d81b767d8036c7fdec7ca20100 (diff)
downloadadvtrains-922e654b7bef51c7ddaf510ec70880d48181dd35.tar.gz
advtrains-922e654b7bef51c7ddaf510ec70880d48181dd35.tar.bz2
advtrains-922e654b7bef51c7ddaf510ec70880d48181dd35.zip
Make Buffers become implicitly their own TCBs and signals when interlocking is enabled
Diffstat (limited to 'advtrains_interlocking/route_prog.lua')
-rw-r--r--advtrains_interlocking/route_prog.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/advtrains_interlocking/route_prog.lua b/advtrains_interlocking/route_prog.lua
index 2f0f8ee..3bdf6d6 100644
--- a/advtrains_interlocking/route_prog.lua
+++ b/advtrains_interlocking/route_prog.lua
@@ -535,9 +535,12 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
-- show formspec
show_routing_form(pname, tcbpos)
-
advtrains.interlocking.visualize_route(rp.origin, rp.route, "prog_"..pname, rp.tmp_lcks, pname)
-
+ return
+ elseif advtrains.interlocking.database.get_tcb(pos) then
+ -- the punched node itself is a TCB
+ show_routing_form(pname, pos)
+ advtrains.interlocking.visualize_route(rp.origin, rp.route, "prog_"..pname, rp.tmp_lcks, pname)
return
end
if advtrains.is_passive(pos) then