Browse Source

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
pull/2/head
Alibek Omarov 3 years ago
parent
commit
46fd27eb14
  1. 10
      engine/client/console.c

10
engine/client/console.c

@ -1812,16 +1812,6 @@ void Key_Console( int key )
// enter finishes the line // enter finishes the line
if( key == K_ENTER || key == K_KP_ENTER ) 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 // backslash text are commands, else chat
if( con.input.buffer[0] == '\\' || con.input.buffer[0] == '/' ) if( con.input.buffer[0] == '\\' || con.input.buffer[0] == '/' )
Cbuf_AddText( con.input.buffer + 1 ); // skip backslash Cbuf_AddText( con.input.buffer + 1 ); // skip backslash

Loading…
Cancel
Save