From b51fbe499f1fd68a1abcbdee913cde1ccb580bca Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 6 Apr 2014 23:28:53 +0300 Subject: [PATCH] Don't set pure_speed and accurate_position when halted It may happen that the train has enough momentum to roll onto the next sensor when halt occurs. Setting accurate_position in this case is likely to cause a sensor missed emergency when halt is lifted, as the physical locomotive takes a moment to get up to speed again. --- source/libr2c2/train.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 34b80dd..8e10026 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -487,8 +487,11 @@ void Train::sensor_state_changed(Sensor &sensor, Sensor::State state) last_entry_block = allocator.iter_for(*block); travel_time = Time::zero; - pure_speed = true; - accurate_position = true; + if(!layout.get_driver().is_halted()) + { + pure_speed = true; + accurate_position = true; + } overshoot_dist = 0; if(!advancing && vehicles.front()->is_placed()) -- 2.45.2