From b41c7409da959420aed91e8a2e1fdab95ef473c4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 13 Feb 2011 20:50:46 +0000 Subject: [PATCH] Ignore dubious speed measurements when finding speed step --- source/libr2c2/train.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 5b03e9b..218b686 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -1180,10 +1180,10 @@ unsigned Train::find_speed_step(float real) const if(real_speed[i].weight) { last = i; - if(real_speed[i].speed=real) high = i; + else if(real_speed[i].speed>real_speed[low].speed) + low = i; } if(!high) { -- 2.43.0