]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 acfad510299b8c38f12cf341bd6a325a59c594f2..6bd0b361c93a4ce6bf4257248af1b8791dc7844e 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;