X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrainrouter.cpp;h=38027dbe896942f6b232b1abcd565393a99d9ca5;hb=193220dca4f520379b23160787ec60315903d49c;hp=cef98eebbe46c3a5793579b168d970e4e6734957;hpb=bb75bc76ddd99e7d3edaf6e7dbd3719ea332052c;p=r2c2.git diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index cef98ee..38027db 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -77,6 +77,7 @@ void TrainRouter::route_changed() can't rely on the resync code in block_reserved since we may need to clear the stop marker to continue allocation. */ TrackIter track = train.get_block_allocator().first().track_iter(); + list::iterator seq_begin = sequence_points.begin(); for(; track; track=track.next()) { if(!advance_to_track(reserving_route, track)) @@ -86,7 +87,15 @@ void TrainRouter::route_changed() } if(&track->get_block()==fncb.block()) break; + + if(seq_begin!=sequence_points.end() && seq_begin->block==&track->get_block()) + { + current_sequence = seq_begin->sequence_out; + ++seq_begin; + } } + + sequence_points.erase(sequence_points.begin(), seq_begin); } if(!already_at_end)