1
0
Fork 0

Fix errors with missing runways at KORD

This likely relates to stale runway preferences data.
This commit is contained in:
James Turner 2020-08-11 18:30:04 +01:00
parent 21629402ce
commit fa76d5b158
2 changed files with 12 additions and 8 deletions

View file

@ -189,11 +189,14 @@ bool FGAirport::hasHelipadWithIdent(const std::string& aIdent) const
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
FGRunwayRef FGAirport::getRunwayByIdent(const std::string& aIdent) const FGRunwayRef FGAirport::getRunwayByIdent(const std::string& aIdent) const
{ {
loadRunways(); if (aIdent.empty())
for (auto rwy : mRunways) { return {};
if (rwy->ident() == aIdent) {
return rwy; loadRunways();
} for (auto rwy : mRunways) {
if (rwy->ident() == aIdent) {
return rwy;
}
} }
SG_LOG(SG_GENERAL, SG_ALERT, "no such runway '" << aIdent << "' at airport " << ident()); SG_LOG(SG_GENERAL, SG_ALERT, "no such runway '" << aIdent << "' at airport " << ident());

View file

@ -796,10 +796,11 @@ bool FGAirportDynamics::innerGetActiveRunway(const string & trafficType,
if (action == 2) // landing if (action == 2) // landing
{ {
int nr = landing.size(); if (!landing.empty()) {
if (nr) {
runway = chooseRwyByHeading(landing, heading); runway = chooseRwyByHeading(landing, heading);
} else { //fallback }
if (runway.empty()) { //fallback
runway = chooseRunwayFallback(); runway = chooseRunwayFallback();
} }
} }