- rewrote test for occupied sound channel without special types

https://forum.zdoom.org/viewtopic.php?t=66613
This commit is contained in:
alexey.lysiuk 2019-12-10 13:36:05 +02:00
parent f050a23541
commit 3cb571c1d5
1 changed files with 3 additions and 16 deletions

View File

@ -527,22 +527,9 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
{
if (chan->SourceType == type && chan->EntChannel == channel)
{
bool foundit;
switch (type)
{
case SOURCE_Actor:
case SOURCE_Sector:
case SOURCE_Polyobj:
foundit = chan->Source == source;
break;
case SOURCE_Unattached:
foundit = chan->Point[0] == pt->X && chan->Point[2] == pt->Z && chan->Point[1] == pt->Y;
break;
default:
foundit = false;
break;
}
const bool foundit = (type == SOURCE_Unattached)
? (chan->Point[0] == pt->X && chan->Point[2] == pt->Z && chan->Point[1] == pt->Y)
: (chan->Source == source);
if (foundit)
{