]> git.tdb.fi Git - r2c2.git/commitdiff
Declare emergency if route planning fails
authorMikko Rasa <tdb@tdb.fi>
Fri, 13 Feb 2015 00:47:25 +0000 (02:47 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 13 Feb 2015 00:47:25 +0000 (02:47 +0200)
source/libr2c2/trainrouter.cpp

index 9befe4788c4b03114cfe4939f6ea7c02eee0fe06..a5a63b4f7754f18f7f688616696a3a4a924359ae 100644 (file)
@@ -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<TrainRouter *> routers;
        get_routers(layout, routers);