diff --git a/track.c b/track.c index 79e89a9..2be134b 100644 --- a/track.c +++ b/track.c @@ -308,7 +308,9 @@ static int doLocalCPR(struct aircraft *a, struct modesMessage *mm, uint64_t now, // at 200NM distance, this may resolve to a position // at (200-360) = 160NM in the wrong direction) - if (Modes.maxRange <= 1852*180) { + if (Modes.maxRange == 0) { + return (-1); // Can't do receiver-centered checks at all + } else if (Modes.maxRange <= 1852*180) { range_limit = Modes.maxRange; } else if (Modes.maxRange < 1852*360) { range_limit = (1852*360) - Modes.maxRange;