Enforce max-range on mlat results (but still skip the speed check)
Fixes #97
This commit is contained in:
parent
356cda2917
commit
e101351b6e
8
track.c
8
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++;
|
||||
|
|
Loading…
Reference in a new issue