From 9c743fc4c99969e8d79320afeaa03501cd4ec78a Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 29 Jan 2005 10:22:44 +0000 Subject: [PATCH] Geoff Air: RE: --aircraft=ufo in system.fgfsrc is ignored To change a 'feature', one that has been mentioned here many times, and again recently, place the following code block into fgInitFGAircraft. In its favour, I would argue this means FG can be run without a command line, provided FG_ROOT has been set in the environment, and that seems to me, as it should be ... ;=)) Perhaps the only counter, is that system.fgfsrc is read twice, but so are others, like .fgfsrc, for other (local) options ... or system.fgfsrc should .nt. be used for 'aircraft' ? --- src/Main/fg_init.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 8dcefe3d1..66d0a4809 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -343,6 +343,12 @@ bool fgInitFGAircraft ( int argc, char **argv ) { // if an aircraft was specified, set the property name if ( !aircraft.empty() ) { SG_LOG(SG_INPUT, SG_INFO, "aircraft = " << aircraft ); + if ( aircraft.empty() ) { + // Check for $fg_root/system.fgfsrc + SGPath sysconf( globals->get_fg_root() ); + sysconf.append( "system.fgfsrc" ); + aircraft = fgScanForOption( "--aircraft=", sysconf.str() ); + } fgSetString("/sim/aircraft", aircraft.c_str() ); } else { SG_LOG(SG_INPUT, SG_INFO, "No user specified aircraft, using default" );