Skip to content

Commit

Permalink
fix: processing out of range aircraft
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LeoKle committed Sep 15, 2024
1 parent 5a4be28 commit 836e044
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/DataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,11 @@ void DataManager::setActiveAirports(const std::list<std::string> 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);
Expand Down

0 comments on commit 836e044

Please sign in to comment.