From d27013f6fa4a84cd088d9e7eb7901512304bbea3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 13 Feb 2015 02:47:25 +0200 Subject: [PATCH] Declare emergency if route planning fails --- source/libr2c2/trainrouter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 9befe47..a5a63b4 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -537,6 +537,9 @@ void TrainRouter::start_planning(Layout &layout) void TrainRouter::apply_plan(Layout &layout, TrainRoutePlanner &planner) { + if(planner.get_result()==TrainRoutePlanner::FAILED) + layout.emergency(0, "Route planning failed"); + vector routers; get_routers(layout, routers); -- 2.45.2