diff options
author | orwell96 <orwell@bleipb.de> | 2019-02-12 22:17:43 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2019-02-12 22:17:43 +0100 |
commit | ede60d0a174d7439c42b9001008e08ef487c5416 (patch) | |
tree | 22038ac551d62f6ace148cbb6ff95fb94216f6f8 | |
parent | 4112476bc9c2d29e89bcbe83c5b7073fd38de068 (diff) | |
download | advtrains-ede60d0a174d7439c42b9001008e08ef487c5416.tar.gz advtrains-ede60d0a174d7439c42b9001008e08ef487c5416.tar.bz2 advtrains-ede60d0a174d7439c42b9001008e08ef487c5416.zip |
Fix routesetting when TCBS is missing (H#109)
-rw-r--r-- | advtrains_interlocking/routesetting.lua | 4 |
1 files changed, 4 insertions, 0 deletions
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 |