Check sfx->fetcher instead of ch_ind < 0 before freeing an sfx, since ch_ind < 0...
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 31 Dec 2009 09:56:34 +0000 (09:56 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 31 Dec 2009 09:56:34 +0000 (09:56 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9759 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.c

index acfad51..6bd0b36 100644 (file)
@@ -262,7 +262,7 @@ static void S_Play_Common (float fvol, float attenuation)
                        ch_ind = S_StartSound (-1, 0, sfx, listener_origin, fvol, attenuation);
 
                        // Free the sfx if the file didn't exist
-                       if (ch_ind < 0)
+                       if (!sfx->fetcher)
                                S_FreeSfx (sfx, false);
                        else
                                channels[ch_ind].flags |= CHANNELFLAG_LOCALSOUND;