]> git.tdb.fi Git - r2c2.git/commitdiff
Only consider arrival when a route is set
authorMikko Rasa <tdb@tdb.fi>
Sun, 17 Feb 2013 13:25:33 +0000 (15:25 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 17 Feb 2013 13:25:33 +0000 (15:25 +0200)
source/libr2c2/trainrouter.cpp

index 160c5b6a0c904cee6112608d033f9fef8bbe8c01..c39af92c246e9ed30ce78ded29d40832dc8e8925 100644 (file)
@@ -283,10 +283,13 @@ void TrainRouter::train_advanced(Block &block)
                }
        }
 
-       BlockIter iter(&block, train.get_entry_to_block(block));
-       iter = iter.next();
-       if(iter && !is_on_route(*iter))
-               arriving = true;
+       if(!routes.empty())
+       {
+               BlockIter iter(&block, train.get_entry_to_block(block));
+               iter = iter.next();
+               if(iter && !is_on_route(*iter))
+                       arriving = true;
+       }
 }
 
 const Route *TrainRouter::get_route_for_block(const Block &block) const