# HG changeset patch # User Adam Kaminski # Date 1607129287 18000 # Fri Dec 04 19:48:07 2020 -0500 # Node ID 671a67ab6b3cdd9e16d366bb8feacbfd0af4c535 # Parent 47a516a3b9af707bb6ae5f9a5d4a069dd73ed7f4 The chat sound shouldn't play for messages that aren't printed because they're below the minimum message level requirements. diff -r 47a516a3b9af -r 671a67ab6b3c src/c_console.cpp --- a/src/c_console.cpp Fri Dec 04 19:47:14 2020 -0500 +++ b/src/c_console.cpp Fri Dec 04 19:48:07 2020 -0500 @@ -2501,3 +2501,11 @@ { return g_IsCapturing; } + +// +// [AK] Gets the minimum message level. +// +int C_GetMessageLevel() +{ + return msglevel; +} \ No newline at end of file diff -r 47a516a3b9af -r 671a67ab6b3c src/c_console.h --- a/src/c_console.h Fri Dec 04 19:47:14 2020 -0500 +++ b/src/c_console.h Fri Dec 04 19:48:07 2020 -0500 @@ -98,4 +98,7 @@ const char* C_EndCapture(); bool C_IsCapturing(); +// [AK] +int C_GetMessageLevel(); + #endif diff -r 47a516a3b9af -r 671a67ab6b3c src/chat.cpp --- a/src/chat.cpp Fri Dec 04 19:47:14 2020 -0500 +++ b/src/chat.cpp Fri Dec 04 19:48:07 2020 -0500 @@ -880,7 +880,8 @@ Printf( ulChatLevel, "%s\n", OutString.GetChars() ); // [BB] If the user doesn't want to see the messages, they shouldn't make a sound. - if ( show_messages ) + // [AK] Also take into account the minimum message level. + if (( show_messages ) && ( ulChatLevel >= C_GetMessageLevel() )) { // [RC] User can choose the chat sound. int sound = ( ulMode > CHATMODE_TEAM ) ? privatechat_sound : chat_sound;