From: Mikko Rasa Date: Thu, 20 Mar 2014 22:33:59 +0000 (+0200) Subject: Clear destination when setting a null route X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=64989fc7180b55a6f12c997cb13d326c388eddc8;p=r2c2.git Clear destination when setting a null route --- 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();