]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/trainrouter.cpp
Don't attempt to use planned route if no waypoints are set
[r2c2.git] / 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);