Fix errors

This commit is contained in:
TehRealSalt 2018-03-24 08:13:33 -04:00
parent a980e8b0d9
commit 8bc2fa7b6c

View file

@ -1022,12 +1022,12 @@ void S_UpdateSounds(void)
if (splitscreen) if (splitscreen)
{ {
const mobj_t *soundmobj = c->origin; const mobj_t *soundmobj = c->origin;
fixed_t recdist; fixed_t recdist = -1;
INT32 i, p = -1; INT32 i, p = -1;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
fixed_t thisdist; fixed_t thisdist = -1;
if (i > splitscreen) if (i > splitscreen)
break; break;
@ -1043,7 +1043,7 @@ void S_UpdateSounds(void)
else else
continue; continue;
if (recdist == NULL || (thisdist != NULL && thisdist < recdist)) if (recdist == -1 || (thisdist != -1 && thisdist < recdist))
{ {
recdist = thisdist; recdist = thisdist;
p = i; p = i;
@ -1052,13 +1052,7 @@ void S_UpdateSounds(void)
if (p != -1) if (p != -1)
{ {
if (p == 0) if (p == 1)
{
// Player 1 gets the sound
audible = S_AdjustSoundParams(listenmobj, c->origin, &volume, &sep, &pitch,
c->sfxinfo);
}
else if (p == 1)
{ {
// Player 2 gets the sound // Player 2 gets the sound
audible = S_AdjustSoundParams(listenmobj2, c->origin, &volume, &sep, &pitch, audible = S_AdjustSoundParams(listenmobj2, c->origin, &volume, &sep, &pitch,
@ -1076,6 +1070,12 @@ void S_UpdateSounds(void)
audible = S_AdjustSoundParams(listenmobj4, c->origin, &volume, &sep, &pitch, audible = S_AdjustSoundParams(listenmobj4, c->origin, &volume, &sep, &pitch,
c->sfxinfo); c->sfxinfo);
} }
else
{
// Player 1 gets the sound
audible = S_AdjustSoundParams(listenmobj, c->origin, &volume, &sep, &pitch,
c->sfxinfo);
}
if (audible) if (audible)
I_UpdateSoundParams(c->handle, volume, sep, pitch); I_UpdateSoundParams(c->handle, volume, sep, pitch);