From 68877070660f2806cc2a7f0ccb69153059ef6ce7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 20 Feb 2015 11:53:45 +0200 Subject: [PATCH] Don't attempt to use planned route if no waypoints are set --- source/libr2c2/trainrouter.cpp | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.45.2