From: Mikko Rasa Date: Sun, 17 Feb 2013 13:25:33 +0000 (+0200) Subject: Only consider arrival when a route is set X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c3cdedda4cec4443e144710af76a190979b4d3c8;p=r2c2.git Only consider arrival when a route is set --- diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 160c5b6..c39af92 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -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