From: ThorstenB Date: Mon, 30 Apr 2012 15:48:13 +0000 (+0200) Subject: #248: support enabling AI module at run-time X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a2c2373758a93fc7e1c357c62915b1ac10ea0221;p=flightgear.git #248: support enabling AI module at run-time Move /sim/ai/enabled check behind the MP enabled check. --- diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index f42d53432..2d2d38fa0 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -406,12 +406,6 @@ FGMultiplayMgr::init (void) fgSetBool("/sim/multiplay/online", false); - if (!fgGetBool("/sim/ai/enabled")) - { - // multiplayer depends on AI module - fgSetBool("/sim/ai/enabled", true); - } - ////////////////////////////////////////////////// // Set members from property values ////////////////////////////////////////////////// @@ -444,7 +438,7 @@ FGMultiplayMgr::init (void) if (rxPort <= 0) rxPort = txPort; } else { - SG_LOG(SG_NETWORK, SG_ALERT, "Cannot enable multiplayer mode: missing a valid server address."); + SG_LOG(SG_NETWORK, SG_INFO, "FGMultiplayMgr - multiplayer mode disabled (no MP server specificed)."); return; } @@ -483,6 +477,12 @@ FGMultiplayMgr::init (void) mInitialised = true; SG_LOG(SG_NETWORK, SG_ALERT, "Multiplayer mode active!"); + + if (!fgGetBool("/sim/ai/enabled")) + { + // multiplayer depends on AI module + fgSetBool("/sim/ai/enabled", true); + } } // FGMultiplayMgr::init() //////////////////////////////////////////////////////////////////////