From ede60d0a174d7439c42b9001008e08ef487c5416 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Tue, 12 Feb 2019 22:17:43 +0100 Subject: Fix routesetting when TCBS is missing (H#109) --- advtrains_interlocking/routesetting.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua index f65cd06..0b2d6dd 100644 --- a/advtrains_interlocking/routesetting.lua +++ b/advtrains_interlocking/routesetting.lua @@ -62,6 +62,10 @@ function ilrs.set_route(signal, route, try) local c_tcbs, c_ts_id, c_ts, c_rseg, c_lckp while c_sigd and i<=#route do c_tcbs = ildb.get_tcbs(c_sigd) + if not c_tcbs then + if not try then atwarn("Did not find TCBS",c_sigd,"while setting route",rtename,"of",signal) end + return false, "No TCB found at "..sigd_to_string(c_sigd)..". Please reconfigure route!" + end c_ts_id = c_tcbs.ts_id if not c_ts_id then if not try then atwarn("Encountered End-Of-Interlocking while setting route",rtename,"of",signal) end -- cgit v1.2.3