Add con_autochat and con_autoclear cvars

This commit is contained in:
Zack Middleton 2017-06-07 22:09:51 -05:00
parent c12b81a273
commit dfce71929a
6 changed files with 35 additions and 7 deletions

View file

@ -95,6 +95,9 @@ cvar_t *com_legacyprotocol;
cvar_t *com_basegame;
cvar_t *com_homepath;
cvar_t *com_busyWait;
#ifndef DEDICATED
cvar_t *con_autochat;
#endif
#if idx64
int (*Q_VMftol)(void);
@ -2784,6 +2787,10 @@ void Com_Init( char *commandLine ) {
#endif
Cvar_Get("protocol", com_protocol->string, CVAR_ROM);
#ifndef DEDICATED
con_autochat = Cvar_Get("con_autochat", "1", CVAR_ARCHIVE);
#endif
Sys_Init();
Sys_InitPIDFile( FS_GetCurrentGameDir() );
@ -3471,8 +3478,8 @@ void Field_CompleteCommand( char *cmd,
completionString = Cmd_Argv( completionArgument - 1 );
#ifndef DEDICATED
// Unconditionally add a '\' to the start of the buffer
if( completionField->buffer[ 0 ] &&
// add a '\' to the start of the buffer if it might be sent as chat otherwise
if( con_autochat->integer && completionField->buffer[ 0 ] &&
completionField->buffer[ 0 ] != '\\' )
{
if( completionField->buffer[ 0 ] != '/' )