Rearrange position cleanup to be a bit more obvious.
Previously it forgot to advance to the next aircraft and only happened to work because it cleared the position bitflags and so the next iteration (on the same aircraft) would advance.
This commit is contained in:
parent
a60270e20e
commit
03ba828f8d
7
track.c
7
track.c
|
@ -636,10 +636,11 @@ static void trackRemoveStaleAircraft(uint64_t now)
|
|||
} else {
|
||||
prev->next = a->next; free(a); a = prev->next;
|
||||
}
|
||||
} else if ((a->bFlags & MODES_ACFLAGS_LATLON_VALID) && (now - a->seenLatLon) > TRACK_AIRCRAFT_POSITION_TTL) {
|
||||
/* Position is too old and no longer valid */
|
||||
a->bFlags &= ~(MODES_ACFLAGS_LATLON_VALID | MODES_ACFLAGS_LATLON_REL_OK);
|
||||
} else {
|
||||
if ((a->bFlags & MODES_ACFLAGS_LATLON_VALID) && (now - a->seenLatLon) > TRACK_AIRCRAFT_POSITION_TTL) {
|
||||
/* Position is too old and no longer valid */
|
||||
a->bFlags &= ~(MODES_ACFLAGS_LATLON_VALID | MODES_ACFLAGS_LATLON_REL_OK);
|
||||
}
|
||||
prev = a; a = a->next;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue