From e9560899a388c2ba31fb7e9e6d43c152644f603f Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Tue, 11 Dec 2007 22:03:17 +0000 Subject: [PATCH] fixed panning problem --- src/engine/client/snd.c | 5 +++++ src/game/client/game_client.cpp | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/engine/client/snd.c b/src/engine/client/snd.c index 603683f78..9d851dccf 100644 --- a/src/engine/client/snd.c +++ b/src/engine/client/snd.c @@ -185,6 +185,11 @@ static void mix(short *final_out, unsigned frames) lvol = (lvol*(range-dist))/range; rvol = (rvol*(range-dist))/range; } + else + { + lvol = 0; + rvol = 0; + } } /* process all frames */ diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index f1c8e49c0..75899ae5b 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -2106,9 +2106,6 @@ void render_game() if(local_info && local_info->team == -1) spectate = true; - // set listner pos - snd_set_listener_pos(local_character_pos.x, local_character_pos.y); - animstate idlestate; anim_eval(&data->animations[ANIM_BASE], 0, &idlestate); anim_eval_add(&idlestate, &data->animations[ANIM_IDLE], 0, 1.0f); @@ -2231,10 +2228,17 @@ void render_game() } } + // set listner pos if(spectate) + { local_target_pos = mouse_pos; + snd_set_listener_pos(mouse_pos.x, mouse_pos.y); + } else + { local_target_pos = local_character_pos + mouse_pos; + snd_set_listener_pos(local_character_pos.x, local_character_pos.y); + } // snap input {