From 5cdb35f5082061cd4f41052e47be4e93726a9a19 Mon Sep 17 00:00:00 2001 From: Logan Date: Fri, 11 Sep 2020 08:30:53 -0400 Subject: [PATCH] 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. --- engine/client/cl_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index e36217c0..707bc27b 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -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 ); } /*