Skip to content

Commit

Permalink
Fix bug where a .ese defined runway not in HKCPApproaches.json causes…
Browse files Browse the repository at this point in the history
… HKCP to crash (#32)
  • Loading branch information
arthuwu authored Aug 2, 2024
1 parent 32542df commit 14bc81a
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions AT3/AT3Tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,14 @@ string AT3Tags::GetAPPDEPLine4(CFlightPlan& FlightPlan, CRadarTarget& RadarTarge
}
}
else if (arptSet.find(FlightPlan.GetFlightPlanData().GetDestination()) != arptSet.end() && strlen(FlightPlan.GetFlightPlanData().GetArrivalRwy()) != 0) {
string app = GetAvailableApps(FlightPlan.GetFlightPlanData().GetDestination(), FlightPlan.GetFlightPlanData().GetArrivalRwy())[0]; //selects default app if no assignment, which is [0]
if (app.find("_") != string::npos) {
lineStr = app.substr(0, app.find("_"));
string spadItem = "/A/" + app + "/A//";
FlightPlan.GetControllerAssignedData().SetFlightStripAnnotation(2, spadItem.c_str());
vector<string> appsVec = GetAvailableApps(FlightPlan.GetFlightPlanData().GetDestination(), FlightPlan.GetFlightPlanData().GetArrivalRwy());
if (appsVec.size() > 0) {
string app = appsVec[0]; //selects default app if no assignment, which is [0]
if (app.find("_") != string::npos) {
lineStr = app.substr(0, app.find("_"));
string spadItem = "/A/" + app + "/A//";
FlightPlan.GetControllerAssignedData().SetFlightStripAnnotation(2, spadItem.c_str());
}
}
}

Expand Down Expand Up @@ -769,11 +772,14 @@ string AT3Tags::GetAMCLine4(CFlightPlan& FlightPlan, CRadarTarget& RadarTarget)
}
}
else if (arptSet.find(FlightPlan.GetFlightPlanData().GetDestination()) != arptSet.end() && strlen(FlightPlan.GetFlightPlanData().GetArrivalRwy()) != 0) {
string app = GetAvailableApps(FlightPlan.GetFlightPlanData().GetDestination(), FlightPlan.GetFlightPlanData().GetArrivalRwy())[0]; //selects default app if no assignment, which is [0]
if (app.find("_") != string::npos) {
lineStr = app.substr(0, app.find("_"));
string spadItem = "/A/" + app + "/A//";
FlightPlan.GetControllerAssignedData().SetFlightStripAnnotation(2, spadItem.c_str());
vector<string> appsVec = GetAvailableApps(FlightPlan.GetFlightPlanData().GetDestination(), FlightPlan.GetFlightPlanData().GetArrivalRwy());
if (appsVec.size() > 0) {
string app = appsVec[0]; //selects default app if no assignment, which is [0]
if (app.find("_") != string::npos) {
lineStr = app.substr(0, app.find("_"));
string spadItem = "/A/" + app + "/A//";
FlightPlan.GetControllerAssignedData().SetFlightStripAnnotation(2, spadItem.c_str());
}
}
}

Expand Down

0 comments on commit 14bc81a

Please sign in to comment.