diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 955e19345..37e91e51f 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -652,10 +652,8 @@ namespace BlackCore if (m_simulatorPlugin.second) // check in case the plugin has been unloaded { - const CStatusMessageList verifyMessages = m_simulatorPlugin.second->debugVerifyStateAfterAllAircraftRemoved(); - m_simulatorPlugin.second->clearAllRemoteAircraftData(); + m_simulatorPlugin.second->clearAllRemoteAircraftData(); // also removes aircraft m_simulatorPlugin.second->setFlightNetworkConnected(false); - if (!verifyMessages.isEmpty()) { emit this->driverMessages(verifyMessages); } } } } diff --git a/src/blackcore/context/contextsimulatorimpl.h b/src/blackcore/context/contextsimulatorimpl.h index 8bfbc1b8f..fad1772b4 100644 --- a/src/blackcore/context/contextsimulatorimpl.h +++ b/src/blackcore/context/contextsimulatorimpl.h @@ -251,7 +251,7 @@ namespace BlackCore bool m_enableMatchingMessages = true; bool m_isWeatherActivated = false; - QString m_networkSessionId; //!< Network session of CServer::getServerSessionId, if not connected empty + QString m_networkSessionId; //!< Network session of CServer::getServerSessionId, if not connected empty (for statistics, ..) // settings BlackMisc::CSettingReadOnly m_enabledSimulators { this, &CContextSimulator::changeEnabledSimulators }; diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index 0edae38ba..5bcb762f1 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -143,6 +143,7 @@ namespace BlackCore void ISimulator::clearAllRemoteAircraftData() { // rendering related stuff + this->physicallyRemoveAllRemoteAircraft(); m_addAgainAircraftWhenRemoved.clear(); m_callsignsToBeRendered.clear(); m_clampedLogMsg.clear(); @@ -695,7 +696,6 @@ namespace BlackCore // a default implementation, but normally overridden by the sims const CCallsignSet callsigns = this->getAircraftInRangeCallsigns(); const int r = this->physicallyRemoveMultipleRemoteAircraft(callsigns); - this->debugVerifyStateAfterAllAircraftRemoved(); this->clearAllRemoteAircraftData(); return r; } diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index ebfc941a1..44118b556 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -263,7 +263,7 @@ namespace BlackSimPlugin CStatusMessageList CSimulatorFsxCommon::debugVerifyStateAfterAllAircraftRemoved() const { CStatusMessageList msgs; - if (CBuildConfig::isLocalDeveloperDebugBuild()) { return msgs; } + if (!CBuildConfig::isLocalDeveloperDebugBuild()) { return msgs; } msgs = CSimulatorFsCommon::debugVerifyStateAfterAllAircraftRemoved(); if (!m_simConnectObjects.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_simConnectObjects not empty: '%1'") << m_simConnectObjects.getAllCallsignStringsAsString(true)); } if (!m_simConnectObjectsPositionAndPartsTraces.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_simConnectObjectsPositionAndPartsTraces not empty: '%1'") << m_simConnectObjectsPositionAndPartsTraces.getAllCallsignStringsAsString(true)); } @@ -1473,10 +1473,7 @@ namespace BlackSimPlugin if (!m_simConnectObjects.contains(callsign)) { return false; } // already fully removed or not yet added CSimConnectObject &simObject = m_simConnectObjects[callsign]; if (simObject.isPendingRemoved()) { return true; } - if (simObject.isTerrainProbe()) - { - return false; - } + if (simObject.isTerrainProbe()) { return false; } // check for pending objects m_addPendingAircraft.remove(callsign); // just in case still in list of pending aircraft @@ -2088,9 +2085,9 @@ namespace BlackSimPlugin void CSimulatorFsxCommon::reset() { this->safeKillTimer(); - this->removeAllProbes(); // still requires connection // cleared below: + // physicallyRemoveAllRemoteAircraft // m_simConnectObjects // m_simConnectObjectsPositionAndPartsTraces // m_addPendingAircraft @@ -2114,12 +2111,13 @@ namespace BlackSimPlugin void CSimulatorFsxCommon::clearAllRemoteAircraftData() { + this->removeAllProbes(); + + // m_addAgainAircraftWhenRemoved cleared below + CSimulatorFsCommon::clearAllRemoteAircraftData(); // also removes aircraft m_simConnectObjects.clear(); m_addPendingAircraft.clear(); m_simConnectObjectsPositionAndPartsTraces.clear(); - this->removeAllProbes(); - // m_addAgainAircraftWhenRemoved cleared below - CSimulatorFsCommon::clearAllRemoteAircraftData(); } QString CSimulatorFsxCommon::fsxPositionToString(const SIMCONNECT_DATA_INITPOSITION &position)