From 444720f62d484cf9886cdbdf5735b5b1ee1d9137 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 9 Dec 2011 17:19:45 +0100 Subject: [PATCH] Avoid useless warnings during FG startup. Do not warn about missing scenery manager, unless it is really needed. Also raise warn level for multiple init calls. --- src/AIModel/AIBase.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index c6a967f8d..7871f7e8e 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -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; } -- 2.39.5