diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index ea7d1f03e..31a0fbd16 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -1019,6 +1019,11 @@ namespace BlackCore m_remoteAircraftProviderConnections.disconnectAll(); // disconnect signals from provider } + bool ISimulator::isAircraftInRangeOrTestMode(const CCallsign &callsign) const + { + return this->isTestMode() || this->isAircraftInRange(callsign); + } + bool ISimulator::disconnectFrom() { // supposed to be overridden diff --git a/src/blackcore/simulator.h b/src/blackcore/simulator.h index e93a9a7dc..ff5de1a3b 100644 --- a/src/blackcore/simulator.h +++ b/src/blackcore/simulator.h @@ -209,6 +209,12 @@ namespace BlackCore //! Simulator running? virtual bool isSimulating() const { return this->isConnected(); } + //! Set test mode + void setTestMode(bool test) { m_test = test; } + + //! Test mode? + bool isTestMode() const { return m_test; } + //! Debug function to check state after all aircraft have been removed //! \remarks only in local developer builds virtual BlackMisc::CStatusMessageList debugVerifyStateAfterAllAircraftRemoved() const; @@ -551,6 +557,9 @@ namespace BlackCore //! Unified qeeing aircraft message void logAddingAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const; + //! Test version aware version of isAircraftInRange + bool isAircraftInRangeOrTestMode(const BlackMisc::Aviation::CCallsign &callsign) const; + //! Lookup against DB data static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model); @@ -620,6 +629,7 @@ namespace BlackCore // misc. bool m_networkConnected = false; //!< flight network connected + bool m_test = false; //!< test mode? BlackMisc::Aviation::CCallsignSet m_callsignsToBeRendered; //!< callsigns which will be rendered BlackMisc::CConnectionGuard m_remoteAircraftProviderConnections; //!< connected signal/slots }; diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index fd5d4b3b9..cf77d4786 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -1602,7 +1602,7 @@ namespace BlackSimPlugin const CSimConnectObject removedPendingObj = this->removeFromAddPendingAndAddAgainAircraft(callsign); // create AI after crosschecking it - if (!probe && !this->isAircraftInRange(callsign)) + if (!probe && !this->isAircraftInRangeOrTestMode(callsign)) { CLogMessage(this).info(u"Skipping adding of '%1' since it is no longer in range") << callsign.asString(); return false;