1
0
Fork 0

Added --failure option.

This commit is contained in:
david 2003-09-10 01:29:19 +00:00
parent d3b7c2ac10
commit 72be3f287a

View file

@ -1100,6 +1100,27 @@ parse_colon (const string &s, double * val1, double * val2)
}
static int
fgOptFailure( const char * arg )
{
string a = arg;
if (a == "pitot") {
fgSetBool("/systems/pitot/serviceable", false);
} else if (a == "static") {
fgSetBool("/systems/static/serviceable", false);
} else if (a == "vacuum") {
fgSetBool("/systems/vacuum/serviceable", false);
} else if (a == "electrical") {
fgSetBool("/systems/electrical/serviceable", false);
} else {
SG_LOG(SG_INPUT, SG_ALERT, "Unknown failure mode: " << a);
return FG_OPTIONS_ERROR;
}
return FG_OPTIONS_OK;
}
static int
fgOptNAV1( const char * arg )
{
@ -1339,6 +1360,7 @@ struct OptionDesc {
{"flight-plan", true, OPTION_FUNC, "", false, "", fgOptFlightPlan },
{"config", true, OPTION_FUNC, "", false, "", fgOptConfig },
{"aircraft", true, OPTION_STRING, "/sim/aircraft", false, "", 0 },
{"failure", true, OPTION_FUNC, "", false, "", fgOptFailure },
{"com1", true, OPTION_DOUBLE, "/radios/comm[0]/frequencies/selected-mhz", false, "", 0 },
{"com2", true, OPTION_DOUBLE, "/radios/comm[1]/frequencies/selected-mhz", false, "", 0 },
{"nav1", true, OPTION_FUNC, "", false, "", fgOptNAV1 },