Add AI models enableing/disableing command line option and support code.
This commit is contained in:
parent
0fda8efa03
commit
4d3e523f90
4 changed files with 13 additions and 2 deletions
|
@ -379,8 +379,7 @@ void FGAIAircraft::ProcessFlightPlan( double dt ) {
|
|||
if (dt_count < 0.1) {
|
||||
return;
|
||||
} else {
|
||||
while (dt_count > 0.1)
|
||||
dt_count -= dt;
|
||||
dt_count = 0;
|
||||
|
||||
// check to see if we've reached the lead point for our next turn
|
||||
double dist_to_go = fp->getDistanceToGo(pos.lat(), pos.lon(), curr);
|
||||
|
|
|
@ -56,6 +56,12 @@ FGAIManager::~FGAIManager() {
|
|||
void FGAIManager::init() {
|
||||
int rval;
|
||||
root = fgGetNode("sim/ai", true);
|
||||
|
||||
enabled = root->getNode("enabled", true)->getStringValue();
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
|
||||
wind_from_down = fgGetNode("/environment/wind-from-down-fps", true);
|
||||
|
||||
for (int i = 0; i < root->nChildren(); i++) {
|
||||
|
@ -140,6 +146,9 @@ void FGAIManager::update(double dt) {
|
|||
range_nearest = 10000.0;
|
||||
strength = 0.0;
|
||||
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
_dt = dt;
|
||||
|
||||
ai_list_itr = ai_list.begin();
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
private:
|
||||
|
||||
bool initDone;
|
||||
bool enabled;
|
||||
int numObjects;
|
||||
SGPropertyNode* root;
|
||||
SGPropertyNode* wind_from_down;
|
||||
|
|
|
@ -1186,6 +1186,8 @@ struct OptionDesc {
|
|||
{"enable-mouse-pointer", false, OPTION_STRING, "/sim/startup/mouse-pointer", false, "enabled", 0 },
|
||||
{"disable-random-objects", false, OPTION_BOOL, "/sim/rendering/random-objects", false, "", 0 },
|
||||
{"enable-random-objects", false, OPTION_BOOL, "/sim/rendering/random-objects", true, "", 0 },
|
||||
{"disable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", false, "", 0 },
|
||||
{"enable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", true, "", 0 },
|
||||
{"disable-freeze", false, OPTION_BOOL, "/sim/freeze/master", false, "", 0 },
|
||||
{"enable-freeze", false, OPTION_BOOL, "/sim/freeze/master", true, "", 0 },
|
||||
{"disable-fuel-freeze", false, OPTION_BOOL, "/sim/freeze/fuel", false, "", 0 },
|
||||
|
|
Loading…
Add table
Reference in a new issue