Avoid coredump on "untracked" aircraft (icao 000000)
Clean up the first-message-squelch logic a little.
This commit is contained in:
parent
04b940d45b
commit
94824fbb98
9
mode_s.c
9
mode_s.c
|
@ -2106,14 +2106,13 @@ void useModesMessage(struct modesMessage *mm) {
|
||||||
// forward messages when we have seen two of them.
|
// forward messages when we have seen two of them.
|
||||||
|
|
||||||
if (Modes.net) {
|
if (Modes.net) {
|
||||||
if (Modes.net_verbatim || mm->msgtype == 32) {
|
if (Modes.net_verbatim || mm->msgtype == 32 || !a) {
|
||||||
// Unconditionally send
|
// Unconditionally send
|
||||||
modesQueueOutput(mm, a);
|
modesQueueOutput(mm, a);
|
||||||
} else if (a->messages > 1) {
|
} else if (a->messages > 1) {
|
||||||
// If this is the second message, and we
|
// Suppress the first message. When we receive a second message,
|
||||||
// squelched the first message, then re-emit the
|
// emit the first two messages.
|
||||||
// first message now.
|
if (a->messages == 2) {
|
||||||
if (!Modes.net_verbatim && a && a->messages == 2) {
|
|
||||||
modesQueueOutput(&a->first_message, a);
|
modesQueueOutput(&a->first_message, a);
|
||||||
}
|
}
|
||||||
modesQueueOutput(mm, a);
|
modesQueueOutput(mm, a);
|
||||||
|
|
Loading…
Reference in a new issue