]> git.mxchange.org Git - flightgear.git/commitdiff
Geoff Air:
authorehofman <ehofman>
Sat, 29 Jan 2005 10:22:44 +0000 (10:22 +0000)
committerehofman <ehofman>
Sat, 29 Jan 2005 10:22:44 +0000 (10:22 +0000)
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

index 8dcefe3d11296b6796423667569fa6a496538f98..66d0a4809d40802b851e4a12d8ab015cadb1ae31 100644 (file)
@@ -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" );