X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrainrouter.cpp;h=122b91a3bd195837f90455cc3da66289d37ea453;hb=68877070660f2806cc2a7f0ccb69153059ef6ce7;hp=5a8d9f7e16cfde6f2654c5f23a696f70bd0e4bc4;hpb=64a4768a48db0f8fde3bf93c512024698f12e3ca;p=r2c2.git diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 5a8d9f7..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); @@ -119,7 +121,7 @@ void TrainRouter::route_changed() if(!sequence_points.empty()) { const SequencePoint &sp = sequence_points.front(); - if(sp.block==fncb.block() && !sp.is_cleared()) + if(sp.block==fncb.block() && sp.preceding_train) { arrival = WAITING_FOR_SEQUENCE; sequence_check_pending = true;