]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/mk_viii.cxx
fix no-hole ladder (not that I think this mode will enjoy a long life)
[flightgear.git] / src / Instrumentation / mk_viii.cxx
index 942c679041bcd2cfd45b34bf428c6bc6a6867d15..118d740b70e64584758f257e336d4d9fa9e6bfe4 100755 (executable)
@@ -235,7 +235,7 @@ MK_VIII::PropertiesHandler::init ()
 void
 MK_VIII::PropertiesHandler::unbind ()
 {
-  vector<SGPropertyNode *>::iterator iter;
+  vector<SGPropertyNode_ptr>::iterator iter;
 
   for (iter = tied_properties.begin(); iter != tied_properties.end(); iter++)
     (*iter)->untie();
@@ -2299,7 +2299,13 @@ MK_VIII::VoicePlayer::get_sample (const char *name)
   std::ostringstream refname;
   refname << mk->name << "[" << mk->num << "]" << "/" << name;
 
-  SGSoundSample *sample = globals->get_soundmgr()->find(refname.str());
+  SGSoundMgr *soundmgr = globals->get_soundmgr();
+  if (soundmgr->is_working() == false)
+    {
+      return NULL;
+    }
+
+  SGSoundSample *sample = soundmgr->find(refname.str());
   if (! sample)
     {
       SGPath sample_path(globals->get_fg_root());
@@ -2316,7 +2322,7 @@ MK_VIII::VoicePlayer::get_sample (const char *name)
          exit(1);
        }
 
-      globals->get_soundmgr()->add(sample, refname.str());
+      soundmgr->add(sample, refname.str());
       samples[refname.str()] = sample;
     }