From 836e0445b1bd031ddb8d7db30cf6496fc2b04fe0 Mon Sep 17 00:00:00 2001 From: LeoKle Date: Sun, 15 Sep 2024 21:43:27 +0200 Subject: [PATCH] fix: processing out of range aircraft flights which are out of range in Euroscope are being simulated by Euroscope and updates are still triggered. We skip these updates to prevent updating the backend with irrelevant aircraft. --- src/core/DataManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/DataManager.cpp b/src/core/DataManager.cpp index 5aa0cc8..2d6aa68 100644 --- a/src/core/DataManager.cpp +++ b/src/core/DataManager.cpp @@ -347,8 +347,11 @@ void DataManager::setActiveAirports(const std::list activeAirports) } void DataManager::queueFlightplanUpdate(EuroScopePlugIn::CFlightPlan flightplan) { + // skip the update if: + // - the flightplan or its data is invalid + // - or the aircraft is out of range therefore GetSimulated() is true if (false == flightplan.IsValid() || nullptr == flightplan.GetFlightPlanData().GetPlanType() || - nullptr == flightplan.GetFlightPlanData().GetOrigin()) + nullptr == flightplan.GetFlightPlanData().GetOrigin() || flightplan.GetSimulated()) return; auto pilot = this->CFlightPlanToPilot(flightplan);