- cleaned up the parameters of A_StartSound.

There were two booleans that could be merged into the flag word.
This also fixes a bug with CHAN_NOSTOP not working for local sounds because it checked the wrong sound source for the playing sound.
This commit is contained in:
Christoph Oelckers 2020-01-04 13:27:50 +01:00
commit b7e1a35e6f
9 changed files with 32 additions and 40 deletions

View file

@ -5911,14 +5911,9 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
if (sid != 0)
{
// What a mess. I think it's a given that this was used with sound flags so it will forever be restricted to the original 8 channels.
if (!looping)
{
S_PlaySound(spot, chan&7, EChanFlags::FromInt(chan&~7), sid, vol, atten, !!local);
}
else if (!S_IsActorPlayingSomething(spot, chan & 7, sid))
{
S_PlaySound(spot, chan&7, EChanFlags::FromInt(chan & ~7)|CHANF_LOOP, sid, vol, atten, !!local);
}
if (local) chan |= CHANF_LOCAL;
if (looping) chan |= CHANF_LOOP | CHANF_NOSTOP;
S_PlaySound(spot, chan&7, EChanFlags::FromInt(chan&~7), sid, vol, atten);
}
}
}