From 3a557489552bd4238bb4ee2faf6e6885b29ec78f Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 7 Dec 2016 03:06:09 +0100 Subject: [PATCH] refs #825, do not render aircraft without callsign (those are likely already gone: logoff, crash) --- src/blackcore/airspacemonitor.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index 46f3180f0..b69bad371 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -614,7 +614,7 @@ namespace BlackCore if (!this->isConnected()) { return; } const CSimulatedAircraft remoteAircraft = this->getAircraftInRangeForCallsign(callsign); - bool complete = remoteAircraft.getModel().hasModelString() || remoteAircraft.getModel().getModelType() == CAircraftModel::TypeFSInnData; + const bool complete = (remoteAircraft.hasValidCallsign() && remoteAircraft.getModel().hasModelString()) || (remoteAircraft.getModel().getModelType() == CAircraftModel::TypeFSInnData); if (trial < 2 && !complete) { @@ -627,13 +627,17 @@ namespace BlackCore } // some checks for special conditions, e.g. logout -> empty list, but still signals pending - emit this->readyForModelMatching(remoteAircraft); - - // log message for matching + if (this->isConnected() && remoteAircraft.hasValidCallsign()) { - const QString msg = QString("Ready for matching '%1' with model type '%2'").arg(callsign.toQString()).arg(remoteAircraft.getModel().getModelTypeAsString()); + const QString msg = QString("Ready for matching '%1' with model type '%2'").arg(callsign.toQString(), remoteAircraft.getModel().getModelTypeAsString()); const CStatusMessage m = CMatchingUtils::logMessage(callsign, msg, getLogCategories()); this->addReverseLookupMessage(callsign, m); + emit this->readyForModelMatching(remoteAircraft); + } + else + { + const CStatusMessage m = CMatchingUtils::logMessage(callsign, "Ignoring this aircraft, not found in range list", getLogCategories()); + this->addReverseLookupMessage(callsign, m); } }