}
SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
+ // Read the default aircraft config file.
+ string aircraft = fgGetString("/sim/aircraft", "");
+ if (aircraft.size() > 0) {
+ SGPath aircraft_path(globals->get_fg_root());
+ aircraft_path.append("Aircraft");
+ aircraft_path.append(aircraft);
+ aircraft_path.concat("-set.xml");
+ SG_LOG(SG_INPUT, SG_INFO, "Reading default aircraft: " << aircraft);
+ try {
+ readProperties(props_path.str(), globals->get_props());
+ } catch (const sg_exception &e) {
+ string message = "Error reading default aircraft: ";
+ message += e.getFormattedMessage();
+ SG_LOG(SG_INPUT, SG_ALERT, message);
+ exit(2);
+ }
+ } else {
+ SG_LOG(SG_INPUT, SG_ALERT, "No default aircraft specified");
+ }
+
// Attempt to locate and parse the various config files in order
// from least precidence to greatest precidence
apath.append( arg.substr(11) );
apath.concat( "-set.xml" );
try {
- SGPropertyNode *sim = fgGetNode("/sim");
- readProperties( apath.str(), sim );
+ readProperties( apath.str(), globals->get_props() );
} catch (const sg_exception &e) {
string message = "Error loading aircraft file: ";
message += e.getFormattedMessage();