1
0
Fork 0

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' ?
This commit is contained in:
ehofman 2005-01-29 10:22:44 +00:00
parent 4ffb6c0fe9
commit 9c743fc4c9

View 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" );