aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/routesetting.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-11-25 22:39:48 +0100
committerorwell <orwell@bleipb.de>2024-11-25 22:39:48 +0100
commita8d53ea2484463f7fc8329cb67b56e4d0f321dbd (patch)
treebf2a264267e70cb69ee1a2b3e627ef5e51964b31 /advtrains_interlocking/routesetting.lua
parent95faa8f1baa68c3f6a104160d61713ade276676b (diff)
downloadadvtrains-a8d53ea2484463f7fc8329cb67b56e4d0f321dbd.tar.gz
advtrains-a8d53ea2484463f7fc8329cb67b56e4d0f321dbd.tar.bz2
advtrains-a8d53ea2484463f7fc8329cb67b56e4d0f321dbd.zip
Clear route_rsn when route commit succeeds and on section entering
Diffstat (limited to 'advtrains_interlocking/routesetting.lua')
-rw-r--r--advtrains_interlocking/routesetting.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua
index 5d7357d..669a604 100644
--- a/advtrains_interlocking/routesetting.lua
+++ b/advtrains_interlocking/routesetting.lua
@@ -348,6 +348,8 @@ function ilrs.update_route(sigd, tcbs, newrte, cancel)
--atdebug("Signal not in control, held by",tcbs.signal_name)
return
end
+ -- clear route_rsn, it will be set again if needed
+ tcbs.route_rsn = nil
if (newrte and tcbs.routeset and tcbs.routeset ~= newrte) or cancel then
if tcbs.route_committed then
--atdebug("Cancelling:",tcbs.routeset)
@@ -359,7 +361,6 @@ function ilrs.update_route(sigd, tcbs, newrte, cancel)
has_changed_aspect = true
tcbs.routeset = nil
tcbs.route_auto = nil
- tcbs.route_rsn = nil
end
if newrte or tcbs.routeset then
if tcbs.route_committed then