]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/trainrouter.cpp
Declare emergency if route planning fails
[r2c2.git] / 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);