Ref T370, re-init terrain probe when all objects are removed

This commit is contained in:
Klaus Basan
2018-09-24 00:54:09 +02:00
parent dcefa88133
commit 09acea6eb4

View File

@@ -2107,6 +2107,7 @@ namespace BlackSimPlugin
void CSimulatorFsxCommon::clearAllRemoteAircraftData()
{
const bool reinitProbe = m_useFsxTerrainProbe;
this->removeAllProbes();
// m_addAgainAircraftWhenRemoved cleared below
@@ -2114,6 +2115,18 @@ namespace BlackSimPlugin
m_simConnectObjects.clear();
m_addPendingAircraft.clear();
m_simConnectObjectsPositionAndPartsTraces.clear();
if (reinitProbe)
{
// if we are still alive we re-init the probes
QPointer<CSimulatorFsxCommon> myself(this);
QTimer::singleShot(2000, this, [ = ]
{
// Shutdown or unloaded
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
m_initFsxTerrainProbes = false; // probes will re-init
});
}
}
QString CSimulatorFsxCommon::fsxPositionToString(const SIMCONNECT_DATA_INITPOSITION &position)