From: Mikko Rasa Date: Sun, 13 Feb 2011 20:50:46 +0000 (+0000) Subject: Ignore dubious speed measurements when finding speed step X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b41c7409da959420aed91e8a2e1fdab95ef473c4;p=r2c2.git Ignore dubious speed measurements when finding speed step --- 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) {