From c3cdedda4cec4443e144710af76a190979b4d3c8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 17 Feb 2013 15:25:33 +0200 Subject: [PATCH] Only consider arrival when a route is set --- source/libr2c2/trainrouter.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.45.2