]> git.mxchange.org Git - flightgear.git/commitdiff
Avoid useless warnings during FG startup.
authorThorstenB <brehmt@gmail.com>
Fri, 9 Dec 2011 16:19:45 +0000 (17:19 +0100)
committerThorstenB <brehmt@gmail.com>
Fri, 9 Dec 2011 16:19:45 +0000 (17:19 +0100)
Do not warn about missing scenery manager, unless it is really needed.
Also raise warn level for multiple init calls.

src/AIModel/AIBase.cxx

index c6a967f8d578e5ddc9f6f6adfe6371912a35c4fd..7871f7e8e08b999ca0b8f15b528b3a6e9681a21b 100644 (file)
@@ -164,6 +164,9 @@ FGAIBase::~FGAIBase() {
 void
 FGAIBase::removeModel()
 {
+    if (!_model.valid())
+        return;
+
     FGScenery* pSceneryManager = globals->get_scenery();
     if (pSceneryManager)
     {
@@ -292,7 +295,7 @@ bool FGAIBase::init(bool search_in_AI_path)
 {
     if (_model.valid())
     {
-        SG_LOG(SG_AI, SG_WARN, "AIBase: Cannot initialize a model multiple times! " << model_path);
+        SG_LOG(SG_AI, SG_ALERT, "AIBase: Cannot initialize a model multiple times! " << model_path);
         return false;
     }