If maxRange is >= 360NM, don't do receiver-centered local CPR at all.
This commit is contained in:
parent
7849e1019d
commit
967a3e9558
6
track.c
6
track.c
|
@ -198,8 +198,12 @@ static int doLocalCPR(struct aircraft *a, int fflag, int surface, uint64_t now)
|
||||||
// ambiguity. (e.g. if we receive a position report
|
// ambiguity. (e.g. if we receive a position report
|
||||||
// at 200NM distance, this may resolve to a position
|
// at 200NM distance, this may resolve to a position
|
||||||
// at (200-360) = 160NM in the wrong direction)
|
// at (200-360) = 160NM in the wrong direction)
|
||||||
if (Modes.maxRange > 1852*180)
|
|
||||||
|
if (Modes.maxRange > 1852*180) {
|
||||||
range_limit = (1852*360) - Modes.maxRange;
|
range_limit = (1852*360) - Modes.maxRange;
|
||||||
|
if (range_limit <= 0)
|
||||||
|
return (-1); // Can't do receiver-centered checks at all
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// No local reference, give up
|
// No local reference, give up
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
Loading…
Reference in a new issue