aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-01-29 22:17:31 +0100
committerorwell <orwell@bleipb.de>2025-01-29 22:17:31 +0100
commit5ba1c48589e855ab3143242de0eafe2890589969 (patch)
tree2315fb619f02549a450098e375eea0fd1ef11e0a /advtrains_interlocking
parent3d3871f8ea5173042238150b86ae5525a4761ad2 (diff)
downloadadvtrains-5ba1c48589e855ab3143242de0eafe2890589969.tar.gz
advtrains-5ba1c48589e855ab3143242de0eafe2890589969.tar.bz2
advtrains-5ba1c48589e855ab3143242de0eafe2890589969.zip
Try to narrow down heisenbug with endless looproute_prog_rework
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r--advtrains_interlocking/train_sections.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/advtrains_interlocking/train_sections.lua b/advtrains_interlocking/train_sections.lua
index 0420463..a1ee87f 100644
--- a/advtrains_interlocking/train_sections.lua
+++ b/advtrains_interlocking/train_sections.lua
@@ -157,13 +157,13 @@ advtrains.tnc_register_on_enter(function(pos, id, train, index)
if tcb and train.path_cp[index] and train.path_cn[index] then
-- forward conn
local connid = train.path_cn[index]
- local ts = tcb[connid].ts_id and ildb.get_ts(tcb[connid].ts_id)
+ local ts = tcb[connid] and tcb[connid].ts_id and ildb.get_ts(tcb[connid].ts_id)
if ts then
setsection(id, train, tcb[connid].ts_id, ts, {p=pos, s=connid})
end
-- backward conn (safety only)
connid = train.path_cp[index]
- ts = tcb[connid].ts_id and ildb.get_ts(tcb[connid].ts_id)
+ ts = tcb[connid] and tcb[connid].ts_id and ildb.get_ts(tcb[connid].ts_id)
if ts then
setsection(id, train, tcb[connid].ts_id, ts, {p=pos, s=connid}, true)
end
@@ -177,7 +177,7 @@ advtrains.tnc_register_on_leave(function(pos, id, train, index)
if tcb and train.path_cp[index] then
-- backward conn
local connid = train.path_cp[index]
- local ts = tcb[connid].ts_id and ildb.get_ts(tcb[connid].ts_id)
+ local ts = tcb[connid] and tcb[connid].ts_id and ildb.get_ts(tcb[connid].ts_id)
if ts then
freesection(id, train, tcb[connid].ts_id, ts)
end