SGPropertyNode_ptr root = new SGPropertyNode;
readProperties(path.str(), root);
return root;
- } catch (const sg_exception &) {
- SG_LOG(SG_GENERAL, SG_DEBUG, "Incorrect path specified for AI "
- "scenario: \"" << path.str() << "\"");
+ } catch (const sg_exception &t) {
+ SG_LOG(SG_GENERAL, SG_ALERT, "Failed to load scenario '"
+ << path.str() << "': " << t.getFormattedMessage());
return 0;
}
}
return FG_OPTIONS_OK;
}
+static int
+fgOptNoScenarios( const char *arg )
+{
+ SGPropertyNode_ptr ai_node = fgGetNode( "/sim/ai", true );
+ ai_node->removeChildren("scenario",false);
+ ai_node->setBoolValue( "enabled", false );
+ return FG_OPTIONS_OK;
+}
+
static int
fgOptRunway( const char *arg )
{
{"min-status", true, OPTION_STRING, "/sim/aircraft-min-status", false, "all", 0 },
{"livery", true, OPTION_FUNC, "", false, "", fgOptLivery },
{"ai-scenario", true, OPTION_FUNC, "", false, "", fgOptScenario },
+ {"disable-ai-scenarios", false, OPTION_FUNC, "", false, "", fgOptNoScenarios},
{"parking-id", true, OPTION_FUNC, "", false, "", fgOptParking },
{"version", false, OPTION_FUNC, "", false, "", fgOptVersion },
{"enable-fpe", false, OPTION_FUNC, "", false, "", fgOptFpe},