]> git.tdb.fi Git - r2c2.git/commitdiff
Fix end-of-route handling at end of track
authorMikko Rasa <tdb@tdb.fi>
Fri, 26 Nov 2010 13:44:12 +0000 (13:44 +0000)
committerMikko Rasa <tdb@tdb.fi>
Fri, 26 Nov 2010 13:44:12 +0000 (13:44 +0000)
source/libr2c2/train.cpp

index 0eaf1e9a0ec91fb62e6947ff15ae2a38851d378e..b2b4899f9aa6eb7cc1ad83cee23039d073c4b5f4 100644 (file)
@@ -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;