aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorY. Wang <y5nw@protonmail.com>2024-08-30 21:57:19 +0000
committerorwell <orwell@bleipb.de>2024-09-02 22:50:22 +0200
commitdd883c5b5ec29e11a78d215d8627f71840051eac (patch)
treeb2a9dfa556ab65a75e5384e3c4649c89df3be62b
parentfcfe21f1976aee7b8db64f1f8ef4aaf5f78a1c06 (diff)
downloadadvtrains-dd883c5b5ec29e11a78d215d8627f71840051eac.tar.gz
advtrains-dd883c5b5ec29e11a78d215d8627f71840051eac.tar.bz2
advtrains-dd883c5b5ec29e11a78d215d8627f71840051eac.zip
Clear tcbs.route_rsn when a route is set
This appears to fix the issue where route_rsn is not cleared and later shown on the train HUD even when the route is set. Note that this only works if the route is (successfully) set after this patch is applied - it does not clear route_rsn for routes that are already set. How to test: * Set a conflicting route for the train. * Set a route for the train. Note that a message appears on the train HUD explaining that the route cannot be set (this is also the current behavior without the patch). * Cancel the conflicting route. Note that the message on the train HUD is cleared.
-rw-r--r--advtrains_interlocking/routesetting.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua
index 67efaea..381fa26 100644
--- a/advtrains_interlocking/routesetting.lua
+++ b/advtrains_interlocking/routesetting.lua
@@ -113,6 +113,7 @@ function ilrs.set_route(signal, route, try)
if c_tcbs.signal then
c_tcbs.route_committed = true
c_tcbs.aspect = route.aspect or advtrains.interlocking.GENERIC_FREE
+ c_tcbs.route_rsn = nil
c_tcbs.route_origin = signal
advtrains.interlocking.update_signal_aspect(c_tcbs)
end