From e7dec69f0ad709dc7e6e5799c5998e571f03681e Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 17 Oct 2024 16:32:01 +0200 Subject: [PATCH] speed_check: decrement speedUnreliable speed is unknown --- track.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/track.c b/track.c index 731f1a99..7f82b36d 100644 --- a/track.c +++ b/track.c @@ -598,7 +598,9 @@ static int speed_check(struct aircraft *a, datasource_t source, double lat, doub range += 250; } - if (distance > 2.5f && (track_diff < 70 || track_diff == -1)) { + if (transmitted_speed < 0) { + mm->speedUnreliable = -1; + } else if (distance > 2.5f && (track_diff < 70 || track_diff == -1)) { if (distance <= range + (((float) elapsed + 50.0f) * (1.0f / 1000.0f)) * (transmitted_speed * knots_to_meterpersecond)) { mm->speedUnreliable = -1; } else if (distance > range + (((float) elapsed + 400.0f) * (1.0f / 1000.0f)) * (transmitted_speed * knots_to_meterpersecond)) {