From baa50c03920fd0a563fce09929f3d56c3374e8bd Mon Sep 17 00:00:00 2001 From: orwell Date: Sat, 20 Jul 2024 18:02:33 +0200 Subject: ARS supports triggering distant signal, other bugfixes --- advtrains_interlocking/train_sections.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'advtrains_interlocking/train_sections.lua') diff --git a/advtrains_interlocking/train_sections.lua b/advtrains_interlocking/train_sections.lua index 41da747..083676b 100644 --- a/advtrains_interlocking/train_sections.lua +++ b/advtrains_interlocking/train_sections.lua @@ -75,7 +75,10 @@ local function setsection(tid, train, ts_id, ts, sigd) end -- routes - local tcbs = advtrains.interlocking.db.get_tcbs(sigd) + local tcbs + if sigd then + tcbs = advtrains.interlocking.db.get_tcbs(sigd) + end -- route setting - clear route state if ts.route then @@ -90,7 +93,7 @@ local function setsection(tid, train, ts_id, ts, sigd) end ts.route = nil end - if tcbs.signal then + if tcbs and tcbs.signal then -- Reset route and signal -- Note that the hit-route case is already handled by cancel_route_from -- this code only handles signal at entering tcb and also triggers for non-route ts -- cgit v1.2.3