about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/components/chat.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp
index a03aab65..37015337 100644
--- a/src/game/client/components/chat.cpp
+++ b/src/game/client/components/chat.cpp
@@ -89,11 +89,6 @@ void CHAT::on_message(int msgtype, void *rawmsg)
 	{
 		NETMSG_SV_CHAT *msg = (NETMSG_SV_CHAT *)rawmsg;
 		add_line(msg->cid, msg->team, msg->message);
-
-		if(msg->cid >= 0)
-			gameclient.sounds->play(SOUNDS::CHN_GUI, SOUND_CHAT_CLIENT, 0, vec2(0,0));
-		else
-			gameclient.sounds->play(SOUNDS::CHN_GUI, SOUND_CHAT_SERVER, 0, vec2(0,0));
 	}
 }
 
@@ -127,6 +122,12 @@ void CHAT::add_line(int client_id, int team, const char *line)
 		str_format(lines[current_line].text, sizeof(lines[current_line].text), ": %s", line);
 	}
 	
+	// play sound
+	if(client_id >= 0)
+		gameclient.sounds->play(SOUNDS::CHN_GUI, SOUND_CHAT_CLIENT, 0, vec2(0,0));
+	else
+		gameclient.sounds->play(SOUNDS::CHN_GUI, SOUND_CHAT_SERVER, 0, vec2(0,0));
+	
 	dbg_msg("chat", "%s%s", lines[current_line].name, lines[current_line].text);
 }