+ /* Torsten Dreyer:
+ hack to stop startup.nas complaining if metar arrives after nasal-dir-initialized
+ is fired. Immediately fetch and wait for the METAR before continuing. This gets the
+ /environment/metar/xxx properties filled before nasal-dir is initialized.
+ Maybe the runway selection should happen here to make startup.nas obsolete?
+ */
+ const char * startup_airport = fgGetString("/sim/startup/options/airport");
+ if( *startup_airport ) {
+ FGAirport * a = FGAirport::getByIdent( startup_airport );
+ if( a ) {
+ SGGeod pos = SGGeod::fromDeg(a->getLongitude(), a->getLatitude());
+ a = FGAirport::findClosest(pos, 10000.0, &airportWithMetarFilter);
+ current_airport_id = a->getId();
+ fetch( current_airport_id );
+ }
+ }