From: divverent Date: Tue, 14 Apr 2009 07:47:25 +0000 (+0000) Subject: fix SND_PickChannel bug choosing an in use channel X-Git-Tag: xonotic-v0.1.0preview~1688 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=2b8e2f6c7403b90e6555218bf68288abb264da20;p=xonotic%2Fdarkplaces.git fix SND_PickChannel bug choosing an in use channel git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8923 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_main.c b/snd_main.c index 943dc5d1..8075c6c1 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1191,7 +1191,7 @@ channel_t *SND_PickChannel(int entnum, int entchannel) { // no sound on this channel first_to_die = ch_idx; - break; + goto emptychan_found; } // don't let monster sounds override player sounds @@ -1212,7 +1212,10 @@ channel_t *SND_PickChannel(int entnum, int entchannel) if (first_to_die == -1) return NULL; + + S_StopChannel (first_to_die, true); +emptychan_found: return &channels[first_to_die]; }