fix the sound spatialisation bug. cl.playernum-1 doesn't work :)

This commit is contained in:
Bill Currie 2000-04-11 09:33:03 +00:00
parent 4e1f949d98
commit c7f6565654

View file

@ -396,7 +396,7 @@ channel_t *SND_PickChannel(int entnum, int entchannel)
}
// don't let monster sounds override player sounds
if (channels[ch_idx].entnum == cl.playernum -1 && entnum != cl.playernum -1 && channels[ch_idx].sfx)
if (channels[ch_idx].entnum == cl.playernum && entnum != cl.playernum && channels[ch_idx].sfx)
continue;
if (channels[ch_idx].end - paintedtime < life_left)
@ -430,13 +430,13 @@ void SND_Spatialize(channel_t *ch)
sfx_t *sndfx;
// anything coming from the view entity will allways be full volume
if (ch->entnum == cl.playernum -1)
if (ch->entnum == cl.playernum)
{
ch->leftvol = ch->master_vol;
ch->rightvol = ch->master_vol;
return;
}
printf("%d %d\n",ch->entnum,cl.playernum);
// calculate stereo seperation and distance attenuation
sndfx = ch->sfx;
@ -1024,7 +1024,7 @@ void S_LocalSound (char *sound)
Con_Printf ("S_LocalSound: can't cache %s\n", sound);
return;
}
S_StartSound (cl.playernum -1, -1, sfx, vec3_origin, 1, 1);
S_StartSound (cl.playernum, -1, sfx, vec3_origin, 1, 1);
}