From: Mikko Rasa Date: Fri, 20 Feb 2015 09:53:45 +0000 (+0200) Subject: Don't attempt to use planned route if no waypoints are set X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=68877070660f2806cc2a7f0ccb69153059ef6ce7;p=r2c2.git Don't attempt to use planned route if no waypoints are set --- diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 9a9d338..122b91a 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -68,6 +68,8 @@ void TrainRouter::use_planned_route() { if(!planner || planner->get_result()!=TrainRoutePlanner::COMPLETE) return; + if(waypoints.empty()) + return; const list &planned_routes = planner->get_routes_for(train);