From 4ff06de475ed47ecb5f39f4007a0da6a2521d924 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 26 Nov 2010 13:44:12 +0000 Subject: [PATCH] Fix end-of-route handling at end of track --- source/libr2c2/train.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.45.2