summaryrefslogtreecommitdiff
path: root/source/cl_parse.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-08-02 14:26:44 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-08-02 14:26:44 +0000
commit5c73f165141b30d93309d25e1324bc0170eb4da5 (patch)
treed84f0c561cff6c9549f3f618f943f7fa15704c71 /source/cl_parse.c
parent3c5ecddd3696c142bf730e808c8184511b525ae3 (diff)
Made Q_ClearStr operate in place and renamed it to COM_strclr.
Removed unused Q_HightlightStr function. Changed Q_ prefix on several functions to COM_ for consistency. Clear the message string before passing it to Cmd_ExecTrigger.
Diffstat (limited to 'source/cl_parse.c')
-rw-r--r--source/cl_parse.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/cl_parse.c b/source/cl_parse.c
index 178f014..75ed182 100644
--- a/source/cl_parse.c
+++ b/source/cl_parse.c
@@ -1326,6 +1326,7 @@ CL_ParsePrint
static void CL_ParsePrint( void ) {
int level;
char string[MAX_STRING_CHARS];
+ const char *fmt;
level = MSG_ReadByte();
MSG_ReadString( string, sizeof( string ) );
@@ -1335,6 +1336,7 @@ static void CL_ParsePrint( void ) {
if( level != PRINT_CHAT ) {
Com_Printf( "%s", string );
if( !cls.demo.playback ) {
+ COM_strclr( string );
Cmd_ExecTrigger( string );
}
return;
@@ -1353,11 +1355,13 @@ static void CL_ParsePrint( void ) {
// filter text
if( cl_chat_filter->integer ) {
- int len = Q_ClearStr( string, string, MAX_STRING_CHARS - 1 );
- string[len] = '\n';
+ COM_strclr( string );
+ fmt = "%s\n";
+ } else {
+ fmt = "%s";
}
- Com_LPrintf( PRINT_TALK, "%s", string );
+ Com_LPrintf( PRINT_TALK, fmt, string );
Con_SkipNotify( qfalse );
@@ -1385,6 +1389,7 @@ static void CL_ParseCenterPrint( void ) {
SCR_CenterPrint( string );
if( !cls.demo.playback ) {
+ COM_strclr( string );
Cmd_ExecTrigger( string );
}
}