From: blub Date: Thu, 31 Dec 2009 09:56:34 +0000 (+0000) Subject: Check sfx->fetcher instead of ch_ind < 0 before freeing an sfx, since ch_ind < 0... X-Git-Tag: xonotic-v0.1.0preview~889 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4be2a5bf75beb62b1644dec10195d5321ef71b4d;p=xonotic%2Fdarkplaces.git 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 --- 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;