From e6b49ce4c5833ab90733aee8e42413f7c75d9da7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 27 Jan 2013 15:26:18 +0200 Subject: [PATCH] Mark turnout blocks before the next sensor as current This avoids a problem where a train leaving a station wouldn't get the following turnouts as current if they needed switching, and consequently could trigger an emergency for not reaching a sensor in time. --- source/libr2c2/train.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index ab52ce6..936f74a 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -1105,6 +1105,8 @@ void Train::check_turnout_paths(bool set) if(i==clear_blocks_end) ++clear_blocks_end; + if(i==cur_blocks_end && !(*i)->get_sensor_id()) + ++cur_blocks_end; } } -- 2.43.0