about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/client/snd.c5
-rw-r--r--src/game/client/game_client.cpp10
2 files changed, 12 insertions, 3 deletions
diff --git a/src/engine/client/snd.c b/src/engine/client/snd.c
index 603683f7..9d851dcc 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 f1c8e49c..75899ae5 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
 	{