Enable AI traffic for offline users and issue #248
- #248: new enable/disable-ai-traffic command-line option - AI traffic: don't wait for METAR when real-wx-fetch disabled, to enable AI traffic when running offline
This commit is contained in:
parent
9a0f0cb15a
commit
4458f7ce73
3 changed files with 8 additions and 5 deletions
|
@ -1334,6 +1334,8 @@ struct OptionDesc {
|
|||
{"metar", true, OPTION_STRING, "/environment/metar/data", false, "", 0 },
|
||||
{"disable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", false, "", 0 },
|
||||
{"enable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", true, "", 0 },
|
||||
{"disable-ai-traffic", false, OPTION_BOOL, "/sim/traffic-manager/enabled", false, "", 0 },
|
||||
{"enable-ai-traffic", false, OPTION_BOOL, "/sim/traffic-manager/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 },
|
||||
|
|
|
@ -79,6 +79,7 @@ FGTrafficManager::FGTrafficManager() :
|
|||
inited(false),
|
||||
enabled("/sim/traffic-manager/enabled"),
|
||||
aiEnabled("/sim/ai/enabled"),
|
||||
realWxEnabled("/environment/realwx/enabled"),
|
||||
metarValid("/environment/metar/valid")
|
||||
{
|
||||
//score = 0;
|
||||
|
@ -232,7 +233,7 @@ void FGTrafficManager::init()
|
|||
|
||||
void FGTrafficManager::update(double /*dt */ )
|
||||
{
|
||||
if (!enabled || !aiEnabled || !metarValid) {
|
||||
if (!enabled || !aiEnabled || (realWxEnabled && !metarValid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ private:
|
|||
void readTimeTableFromFile(SGPath infilename);
|
||||
void Tokenize(const string& str, vector<string>& tokens, const string& delimiters = " ");
|
||||
|
||||
simgear::PropertyObject<bool> enabled, aiEnabled, metarValid;
|
||||
simgear::PropertyObject<bool> enabled, aiEnabled, realWxEnabled, metarValid;
|
||||
public:
|
||||
FGTrafficManager();
|
||||
~FGTrafficManager();
|
||||
|
|
Loading…
Reference in a new issue