]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/trainrouter.cpp
Avoid going past the end of route when a new one is set
[r2c2.git] / source / libr2c2 / trainrouter.cpp
index ca3e93d97d6f8b7126c10fa64f3c8aa212b00463..d1cb6ff4a3a9b8eca35c439edcf8db3258e6e17b 100644 (file)
@@ -111,8 +111,9 @@ void TrainRouter::route_changed()
        {
                // We are not at the end of the route now, but might have been before.
                arrival = ON_THE_WAY;
-               train.stop_at(0);
                train.refresh_blocks_from(*fncb);
+               if(!arrival)
+                       train.stop_at(0);
        }
        else if(!arrival)
        {