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

@ -378,7 +378,7 @@ char *CON_Input( void )
{
#ifndef DEDICATED
// if not in the game explicitly prepend a slash if needed
if (clc.state != CA_ACTIVE && TTY_con.cursor &&
if (clc.state != CA_ACTIVE && con_autochat->integer && TTY_con.cursor &&
TTY_con.buffer[0] != '/' && TTY_con.buffer[0] != '\\')
{
memmove(TTY_con.buffer + 1, TTY_con.buffer, sizeof(TTY_con.buffer) - 1);
@ -389,7 +389,11 @@ char *CON_Input( void )
if (TTY_con.buffer[0] == '/' || TTY_con.buffer[0] == '\\') {
Q_strncpyz(text, TTY_con.buffer + 1, sizeof(text));
} else if (TTY_con.cursor) {
Com_sprintf(text, sizeof(text), "cmd say %s", TTY_con.buffer);
if (con_autochat->integer) {
Com_sprintf(text, sizeof(text), "cmd say %s", TTY_con.buffer);
} else {
Q_strncpyz(text, TTY_con.buffer, sizeof(text));
}
} else {
text[0] = '\0';
}