From: Mikko Rasa Date: Sun, 6 Apr 2014 20:28:53 +0000 (+0300) Subject: Don't set pure_speed and accurate_position when halted X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b51fbe499f1fd68a1abcbdee913cde1ccb580bca;p=r2c2.git 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. --- 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())