From: Mikko Rasa Date: Fri, 26 Nov 2010 13:44:12 +0000 (+0000) Subject: Fix end-of-route handling at end of track X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4ff06de475ed47ecb5f39f4007a0da6a2521d924;p=r2c2.git Fix end-of-route handling at end of track --- diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 0eaf1e9..b2b4899 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -874,7 +874,10 @@ void Train::reserve_more() if(!block || block->get_endpoints().size()<2) { if(!blocking_train) + { good_end = blocks.end(); + end_of_route = true; + } break; } @@ -978,7 +981,7 @@ void Train::reserve_more() contested_blocks.push_back(block); continue; } - else if(divert_track && (entry_conflict || exit_conflict)) + else if(divert_track && (entry_conflict || exit_conflict || !other_train->is_active())) // We are blocked, but there's a diversion possibility try_divert = true;