Skip to content

Commit

Permalink
speed_check: decrement speedUnreliable speed is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Oct 17, 2024
1 parent 431f5d8 commit e7dec69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion track.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit e7dec69

Please sign in to comment.