]> git.tdb.fi Git - r2c2.git/commitdiff
Don't attempt to use planned route if no waypoints are set
authorMikko Rasa <tdb@tdb.fi>
Fri, 20 Feb 2015 09:53:45 +0000 (11:53 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 20 Feb 2015 09:53:45 +0000 (11:53 +0200)
source/libr2c2/trainrouter.cpp

index 9a9d338728140a8edcec2420a821535c9dca38d9..122b91a3bd195837f90455cc3da66289d37ea453 100644 (file)
@@ -68,6 +68,8 @@ void TrainRouter::use_planned_route()
 {
        if(!planner || planner->get_result()!=TrainRoutePlanner::COMPLETE)
                return;
+       if(waypoints.empty())
+               return;
 
        const list<Route *> &planned_routes = planner->get_routes_for(train);