]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_commands.cxx
Fix indentation and mixed-up white-space/tabs
[flightgear.git] / src / Main / fg_commands.cxx
index 92bdea7c041c1dc65b6d31f3c4b0e778d48b8423..e5d72f8a923fa5ef0cf1b6082cc96291280b6d11 100644 (file)
@@ -1106,6 +1106,12 @@ do_set_cursor (const SGPropertyNode * arg)
 static bool
 do_play_audio_sample (const SGPropertyNode * arg)
 {
+    SGSoundMgr *smgr = globals->get_soundmgr();
+    if (!smgr) {
+        SG_LOG(SG_GENERAL, SG_WARN, "play-audio-sample: sound-manager not running");
+        return false;
+    }
+  
     string path = arg->getStringValue("path");
     string file = arg->getStringValue("file");
     float volume = arg->getFloatValue("volume");
@@ -1113,7 +1119,6 @@ do_play_audio_sample (const SGPropertyNode * arg)
     try {
         static FGSampleQueue *queue = 0;
         if ( !queue ) {
-           SGSoundMgr *smgr = globals->get_soundmgr();
            queue = new FGSampleQueue(smgr, "chatter");
            queue->tie_to_listener();
         }