Avoid a crash with out-of-sync airport runway usage and runway definitions.
This commit is contained in:
parent
4f89bf7c48
commit
38687c9e06
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue