diff --git a/libs/console/inputline.c b/libs/console/inputline.c index 66ad23392..4c7095454 100644 --- a/libs/console/inputline.c +++ b/libs/console/inputline.c @@ -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; diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 54927b203..4ded2231b 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -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 ();