1
0
Fork 0

Avoid a crash with out-of-sync airport runway usage and runway definitions.

This commit is contained in:
James Turner 2010-05-19 23:25:39 +01:00
parent 4f89bf7c48
commit 38687c9e06

View file

@ -432,6 +432,12 @@ string FGAirportDynamics::chooseRwyByHeading(stringVec rwys,
double rwyHeading, headingError;
string runway;
for (stringVecIterator i = rwys.begin(); i != rwys.end(); i++) {
if (!_ap->hasRunwayWithIdent(*i)) {
SG_LOG(SG_ATC, SG_WARN, "chooseRwyByHeading: runway " << *i <<
" not found at " << _ap->ident());
continue;
}
FGRunway *rwy = _ap->getRunwayByIdent((*i));
rwyHeading = rwy->headingDeg();
headingError = fabs(heading - rwyHeading);