Skip to content

Commit

Permalink
- rewrote test for occupied sound channel without special types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Dec 10, 2019
1 parent f050a23 commit 3cb571c
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/sound/s_sound.cpp
Expand Up @@ -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)
{
Expand Down

0 comments on commit 3cb571c

Please sign in to comment.