2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-26 11:49:25 +01:00

console: remove prepending backslashes

This is a leftover from Quake, where the console and chat were
in fact same entity. Because Xash splits it, there is no need
in prepending backslashes to separate commands from chat messages
This commit is contained in:
Alibek Omarov 2022-01-04 02:14:34 +03:00
parent f1a4d66d27
commit 46fd27eb14

View File

@ -1812,16 +1812,6 @@ void Key_Console( int key )
// enter finishes the line
if( key == K_ENTER || key == K_KP_ENTER )
{
// if not in the game explicitly prepent a slash if needed
if( cls.state != ca_active && con.input.buffer[0] != '\\' && con.input.buffer[0] != '/' )
{
char temp[MAX_SYSPATH];
Q_strncpy( temp, con.input.buffer, sizeof( temp ));
Q_sprintf( con.input.buffer, "\\%s", temp );
con.input.cursor++;
}
// backslash text are commands, else chat
if( con.input.buffer[0] == '\\' || con.input.buffer[0] == '/' )
Cbuf_AddText( con.input.buffer + 1 ); // skip backslash