]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBase.cxx
properly add librt when clock_gettime is used
[flightgear.git] / src / AIModel / AIBase.cxx
index c6a967f8d578e5ddc9f6f6adfe6371912a35c4fd..07fc6c31a49c38f86883ec0ee03ffd0da94efb70 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;
     }
 
@@ -922,10 +925,7 @@ void FGAIModelData::modelLoaded(const string& path, SGPropertyNode *prop, osg::N
 {
     const char* fxpath = prop->getStringValue("sound/path");
     if (fxpath) {
-        string sound_path = string(fxpath);
-        if (sound_path != "") {
-            _path = "/AI/"+sound_path;
-        }
+        _path = string(fxpath);
     }
     _nasal->modelLoaded(path, prop, n);
 }