]> git.tdb.fi Git - r2c2.git/commitdiff
Clear destination when setting a null route
authorMikko Rasa <tdb@tdb.fi>
Thu, 20 Mar 2014 22:33:59 +0000 (00:33 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 22 Mar 2014 14:20:51 +0000 (16:20 +0200)
source/libr2c2/trainrouter.cpp

index 462af3853d5f04200eef5a0ca657e2006daad28e..65a4a24500206cb0286a1f5cb3da4efc22358c7c 100644 (file)
@@ -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();