From: david Date: Wed, 10 Sep 2003 01:29:19 +0000 (+0000) Subject: Added --failure option. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=72be3f287af481379656303b22f3e00de60ca8ad;p=flightgear.git Added --failure option. --- diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 47b6847ad..90ad11ad9 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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 },