Added "local" parameters to A_PlaySound and ACS PlaySound

This commit is contained in:
nashmuhandes 2016-10-16 02:50:21 +08:00 committed by Rachael Alexanderson
commit 578bf9b09c
5 changed files with 37 additions and 6 deletions

View file

@ -5350,7 +5350,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
case ACSF_PlaySound:
case ACSF_PlayActorSound:
// PlaySound(tid, "SoundName", channel, volume, looping, attenuation)
// PlaySound(tid, "SoundName", channel, volume, looping, attenuation, local)
{
FSoundID sid;
@ -5371,6 +5371,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
float vol = argCount > 3 ? ACSToFloat(args[3]) : 1.f;
INTBOOL looping = argCount > 4 ? args[4] : false;
float atten = argCount > 5 ? ACSToFloat(args[5]) : ATTN_NORM;
INTBOOL local = argCount > 6 ? args[6] : false;
if (args[0] == 0)
{
@ -5387,11 +5388,11 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
{
if (!looping)
{
S_Sound(spot, chan, sid, vol, atten);
S_PlaySound(spot, chan, sid, vol, atten, local);
}
else if (!S_IsActorPlayingSomething(spot, chan & 7, sid))
{
S_Sound(spot, chan | CHAN_LOOP, sid, vol, atten);
S_PlaySound(spot, chan | CHAN_LOOP, sid, vol, atten, local);
}
}
}