From: Mikko Rasa Date: Fri, 13 Feb 2015 00:47:25 +0000 (+0200) Subject: Declare emergency if route planning fails X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d27013f6fa4a84cd088d9e7eb7901512304bbea3;p=r2c2.git Declare emergency if route planning fails --- 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);