slightly cleaner

This commit is contained in:
Bill Currie 2007-05-08 10:49:54 +00:00 committed by Jeff Teunissen
parent fd6a856ae1
commit 01f7bd440e

View file

@ -339,21 +339,13 @@ s_pick_channel (int entnum, int entchannel, int looped)
} }
_ch = &(*_ch)->next; _ch = &(*_ch)->next;
} }
// check for finished looped sounds
// normally, this wouldn't happen, but when using the non-threaded mixer
// it seems to
for (_ch = &looped_dynamic_channels; *_ch; ) {
if (!(*_ch)->sfx || (*_ch)->done) {
SND_ChannelStop (unlink_channel (_ch));
continue;
}
_ch = &(*_ch)->next;
}
// non-looped sounds are used to stop looped sounds on an ent channel // non-looped sounds are used to stop looped sounds on an ent channel
// also clean out any caught by SND_ScanChannels
for (_ch = &looped_dynamic_channels; *_ch; ) { for (_ch = &looped_dynamic_channels; *_ch; ) {
if ((*_ch)->entnum == entnum if (!(*_ch)->sfx || (*_ch)->done
&& ((*_ch)->entchannel == entchannel || entchannel == -1)) { || ((*_ch)->entnum == entnum
&& ((*_ch)->entchannel == entchannel || entchannel == -1))) {
SND_ChannelStop (unlink_channel (_ch)); SND_ChannelStop (unlink_channel (_ch));
continue; continue;
} }