- cleanup of up/down key handling, as per suggestions from james

- add a sv_console_plugin cvar (guess what it does)
This commit is contained in:
Adam Olsen 2001-09-20 15:14:44 +00:00
parent 7195fe8ac7
commit ca51e3be02
2 changed files with 12 additions and 13 deletions

View file

@ -121,24 +121,19 @@ Con_ProcessInputLine (inputline_t *il, int ch)
il->linepos--;
break;
case K_UP:
do {
il->history_line = il->history_line - 1;
if (il->history_line < 0)
il->history_line = il->num_lines - 1;
} while (il->history_line != il->edit_line
&& !il->lines[il->history_line][1]);
if (il->history_line == il->edit_line)
il->history_line = (il->edit_line + 1) % il->num_lines;
{
int j = (il->history_line + il->num_lines - 1) % il->num_lines;
if (j == il->edit_line || !il->lines[j][1])
break;
il->history_line = j;
}
strcpy (il->lines[il->edit_line], il->lines[il->history_line]);
il->linepos = strlen (il->lines[il->edit_line]);
break;
case K_DOWN:
if (il->history_line == il->edit_line)
break;
do {
il->history_line = (il->history_line + 1) % il->num_lines;
} while (il->history_line != il->edit_line
&& !il->lines[il->history_line][1]);
il->history_line = (il->history_line + 1) % il->num_lines;
if (il->history_line == il->edit_line) {
il->lines[il->edit_line][0] = ']';
il->lines[il->edit_line][1] = 0;

View file

@ -91,6 +91,8 @@ double netdosvalues[DOSFLOODCMDS] = { 12, 1, 3, 1, 1, 1 };
cvar_t *fs_globalcfg;
cvar_t *fs_usercfg;
cvar_t *sv_console_plugin;
cvar_t *sv_allow_status;
cvar_t *sv_allow_log;
cvar_t *sv_allow_ping;
@ -2364,7 +2366,9 @@ SV_Init (void)
PI_Init ();
Con_Init ("server");
sv_console_plugin = Cvar_Get ("sv_console_plugin", "server",
CVAR_ROM, 0, "Plugin used for the console");
Con_Init (sv_console_plugin->string);
COM_Filesystem_Init_Cvars ();
Game_Init_Cvars ();