]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_fx.cxx
Merge branch 'next' into durk-atc
[flightgear.git] / src / Sound / fg_fx.cxx
index f1c11f775f176a4b923a35a3dff8db10c94a1856..f60f441145b078ce0ff1bfeca01db33947cad486 100644 (file)
@@ -69,13 +69,12 @@ FGFX::init()
     SGPropertyNode *node = fgGetNode("/sim/sound", true);
 
     string path_str = node->getStringValue("path");
-    SGPath path( globals->get_fg_root() );
     if (path_str.empty()) {
         SG_LOG(SG_GENERAL, SG_ALERT, "No path in /sim/sound/path");
         return;
     }
-
-    path.append(path_str.c_str());
+    
+    SGPath path = globals->resolve_aircraft_path(path_str);
     SG_LOG(SG_GENERAL, SG_INFO, "Reading sound " << node->getName()
            << " from " << path.str());
 
@@ -95,7 +94,7 @@ FGFX::init()
   
             try {
                 sound->init(globals->get_props(), node->getChild(i), this,
-                            _avionics, globals->get_fg_root());
+                            _avionics, path.dir());
   
                 _sound.push_back(sound);
             } catch ( sg_exception &e ) {
@@ -110,6 +109,9 @@ FGFX::init()
 void
 FGFX::reinit()
 {
+    for ( unsigned int i = 0; i < _sound.size(); i++ ) {
+        delete _sound[i];
+    }
     _sound.clear();
     init();
 };