From 4be2a5bf75beb62b1644dec10195d5321ef71b4d Mon Sep 17 00:00:00 2001 From: blub Date: Thu, 31 Dec 2009 09:56:34 +0000 Subject: [PATCH] Check sfx->fetcher instead of ch_ind < 0 before freeing an sfx, since ch_ind < 0 does NOT mean the sfx file didn't exist, but that it failed to play for other (unlikely) reasons. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9759 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snd_main.c b/snd_main.c index acfad510..6bd0b361 100644 --- a/snd_main.c +++ b/snd_main.c @@ -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; -- 2.39.2