Pass cl.viewentity into S_StartSound for pfnPlaySoundByNameAtLocation

This fixes a minor bug where sounds played via pfnPlaySoundByNameAtLocation (mainly from viewmodel animations e.g. MP5) would be left where it was emitted in the world, rather than following the local player as it does in Goldsrc.
This commit is contained in:
Logan 2020-09-11 08:30:53 -04:00 committed by Alibek Omarov
parent 03668116d7
commit 5cdb35f508

View File

@ -2228,7 +2228,7 @@ static pmtrace_t *pfnTraceLine( float *start, float *end, int flags, int usehull
static void GAME_EXPORT pfnPlaySoundByNameAtLocation( char *szSound, float volume, float *origin )
{
int hSound = S_RegisterSound( szSound );
S_StartSound( origin, 0, CHAN_AUTO, hSound, volume, ATTN_NORM, PITCH_NORM, 0 );
S_StartSound( origin, cl.viewentity, CHAN_AUTO, hSound, volume, ATTN_NORM, PITCH_NORM, 0 );
}
/*