aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/routesetting.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_interlocking/routesetting.lua')
-rw-r--r--advtrains_interlocking/routesetting.lua21
1 files changed, 11 insertions, 10 deletions
diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua
index 0b2d6dd..8cde423 100644
--- a/advtrains_interlocking/routesetting.lua
+++ b/advtrains_interlocking/routesetting.lua
@@ -234,6 +234,17 @@ function ilrs.cancel_route_from(sigd)
atwarn("Failed to cancel route, no TCBS at",c_sigd)
return false
end
+
+ --atdebug("cancelling",c_ts.route.rsn)
+ -- clear signal aspect and routesetting state
+ c_tcbs.route_committed = nil
+ c_tcbs.aspect = nil
+ c_tcbs.routeset = nil
+ c_tcbs.route_auto = nil
+ c_tcbs.route_origin = nil
+
+ advtrains.interlocking.update_signal_aspect(c_tcbs)
+
c_ts_id = c_tcbs.ts_id
if not c_tcbs then
atwarn("Failed to cancel route, end of interlocking at",c_sigd)
@@ -248,16 +259,6 @@ function ilrs.cancel_route_from(sigd)
return false
end
- --atdebug("cancelling",c_ts.route.rsn)
- -- clear signal aspect and routesetting state
- c_tcbs.route_committed = nil
- c_tcbs.aspect = nil
- c_tcbs.routeset = nil
- c_tcbs.route_auto = nil
- c_tcbs.route_origin = nil
-
- advtrains.interlocking.update_signal_aspect(c_tcbs)
-
c_ts.route = nil
if c_ts.route_post then