aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/tcb_ts_ui.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-12-13 00:23:18 +0100
committerorwell <orwell@bleipb.de>2024-12-13 00:23:18 +0100
commit7d5f840579b74374698704f256479520bde25091 (patch)
treeb39e32d1b2f518656bb12f2b6641ad31967bac99 /advtrains_interlocking/tcb_ts_ui.lua
parentfe620eccb283a9d6e15c8fdbf564e8e2142da749 (diff)
downloadadvtrains-7d5f840579b74374698704f256479520bde25091.tar.gz
advtrains-7d5f840579b74374698704f256479520bde25091.tar.bz2
advtrains-7d5f840579b74374698704f256479520bde25091.zip
Repair sections on smartroute, detect start!=end TS in routesetting, create section with IL tool aux1route_prog_rework
Diffstat (limited to 'advtrains_interlocking/tcb_ts_ui.lua')
-rwxr-xr-xadvtrains_interlocking/tcb_ts_ui.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index abcdf61..4f755af 100755
--- a/advtrains_interlocking/tcb_ts_ui.lua
+++ b/advtrains_interlocking/tcb_ts_ui.lua
@@ -776,8 +776,16 @@ function advtrains.interlocking.check_route_valid(route, sigd)
end
end
end
+ -- sanity check, is section at next the same as the current?
+ local nvar = c_rseg.next
+ if nvar then
+ local re_tcbs = ildb.get_tcbs({p = nvar.p, s = (nvar.s==1) and 2 or 1})
+ if not re_tcbs or not re_tcbs.ts_id or re_tcbs.ts_id~=c_ts_id then
+ return false, "TCB at "..minetest.pos_to_string(nvar.p).." has different section than previous TCB."
+ end
+ end
-- advance
- c_sigd = c_rseg.next
+ c_sigd = nvar
i = i + 1
end
-- check end TCB