diff --git a/track.c b/track.c index eb22eb3..8d1a4d0 100644 --- a/track.c +++ b/track.c @@ -252,10 +252,6 @@ static int doGlobalCPR(struct aircraft *a, struct modesMessage *mm, uint64_t now return result; } - // for mlat results, accept it unquestioningly - if (mm->bFlags & MODES_ACFLAGS_FROM_MLAT) - return result; - // check max range if (Modes.maxRange > 0 && (Modes.bUserFlags & MODES_USER_LATLON_VALID)) { double range = greatcircle(Modes.fUserLat, Modes.fUserLon, *lat, *lon); @@ -270,6 +266,10 @@ static int doGlobalCPR(struct aircraft *a, struct modesMessage *mm, uint64_t now } } + // for mlat results, skip the speed check + if (mm->bFlags & MODES_ACFLAGS_FROM_MLAT) + return result; + // check speed limit if ((a->bFlags & MODES_ACFLAGS_LATLON_VALID) && a->pos_nuc >= *nuc && !speed_check(a, mm, *lat, *lon, now, surface)) { Modes.stats_current.cpr_global_speed_checks++;