From 64989fc7180b55a6f12c997cb13d326c388eddc8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 21 Mar 2014 00:33:59 +0200 Subject: [PATCH] Clear destination when setting a null route --- source/libr2c2/trainrouter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 462af38..65a4a24 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -57,6 +57,14 @@ bool TrainRouter::set_route(const Route *r) train.stop_at(0); arriving = 0; + /* TODO destination should also be cleared when manually setting a different + route, but not when the planner calls this. */ + if(!r) + { + dest_zone = 0; + dest_block = 0; + } + train.refresh_blocks_from(*fncb); const Route *route = get_route(); -- 2.45.2