- // parse options after loading aircraft to ensure any user
- // overrides of defaults are honored.
- do_options(argc, argv);
-
- return true;
-}
-
-
-// find basic airport location info from airport database
-bool fgFindAirportID( const string& id, FGAirport *a ) {
- const FGAirport* result;
- if ( id.length() ) {
- SG_LOG( SG_GENERAL, SG_INFO, "Searching for airport code = " << id );
-
- result = globals->get_airports()->search( id );
-
- if ( result == NULL ) {
- SG_LOG( SG_GENERAL, SG_ALERT,
- "Failed to find " << id << " in apt.dat.gz" );
- return false;
+#ifdef _MSC_VER
+ char *envp = ::getenv( "APPDATA" );
+ if (envp != NULL ) {
+ SGPath config( envp );
+ config.append( "flightgear.org" );
+#else
+ if ( homedir != NULL ) {
+ SGPath config( homedir );
+ config.append( ".fgfs" );
+#endif
+ config.append( "autosave.xml" );
+ SG_LOG(SG_INPUT, SG_INFO, "Reading user settings from autosave.xml");
+ try {
+ fgLoadProps(config.str().c_str(), globals->get_props(), false,
+ SGPropertyNode::USERARCHIVE);
+ } catch (...) {
+ SG_LOG(SG_INPUT, SG_BULK, "First time reading user settings");