From 96d11df06ce24bf96c503a4811ea37438b4a0dbc Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 5 Sep 2024 13:27:54 +0300 Subject: [PATCH] Revert "engine: client: sounds with zero attenuation must get spatialized anyway" This reverts commit 0870536405ed5d351d66c652d57a4336ddbb9098. --- engine/client/s_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/client/s_main.c b/engine/client/s_main.c index a891084c..3dc44b2e 100644 --- a/engine/client/s_main.c +++ b/engine/client/s_main.c @@ -524,6 +524,9 @@ static void SND_Spatialize( channel_t *ch ) dist = VectorNormalizeLength( source_vec ); dot = DotProduct( s_listener.right, source_vec ); + // don't pan sounds with no attenuation + if( ch->dist_mult <= 0.0f ) dot = 0.0f; + // fill out channel volumes for single location S_SpatializeChannel( &ch->leftvol, &ch->rightvol, ch->master_vol, gain, dot, dist * ch->dist_mult );