From 555eaebb1b7cb7c4a5e1036892b0effbd62766ae Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 21 Jun 2011 11:18:35 +0000 Subject: - Improve game_restart: * differing screen resolutions and network settings are now honoured when changing fs_game * Fix hunk memory leak on game_restart * Move cls.state and cls.servername to clc so connection state is fully preserved over game_restart * Revert back to previous fs_game after disconnecting from a server that triggered a game_restart * Fix error dialog popping up after every game_restart if an error happened previously (reported by Ensiform) - Fixed that not all commands added by CL_Init() would be removed by CL_Shutdown() --- src/client/cl_console.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/client/cl_console.c') diff --git a/src/client/cl_console.c b/src/client/cl_console.c index c7d01bc7..6cb80980 100644 --- a/src/client/cl_console.c +++ b/src/client/cl_console.c @@ -70,7 +70,7 @@ Con_ToggleConsole_f */ void Con_ToggleConsole_f (void) { // Can't toggle the console when it's the only thing available - if ( cls.state == CA_DISCONNECTED && Key_GetCatcher( ) == KEYCATCH_CONSOLE ) { + if ( clc.state == CA_DISCONNECTED && Key_GetCatcher( ) == KEYCATCH_CONSOLE ) { return; } @@ -269,6 +269,21 @@ void Con_Init (void) { Cmd_SetCommandCompletionFunc( "condump", Cmd_CompleteTxtName ); } +/* +================ +Con_Shutdown +================ +*/ +void Con_Shutdown(void) +{ + Cmd_RemoveCommand("toggleconsole"); + Cmd_RemoveCommand("messagemode"); + Cmd_RemoveCommand("messagemode2"); + Cmd_RemoveCommand("messagemode3"); + Cmd_RemoveCommand("messagemode4"); + Cmd_RemoveCommand("clear"); + Cmd_RemoveCommand("condump"); +} /* =============== @@ -400,7 +415,7 @@ Draw the editline after a ] prompt void Con_DrawInput (void) { int y; - if ( cls.state != CA_DISCONNECTED && !(Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) { + if ( clc.state != CA_DISCONNECTED && !(Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) { return; } @@ -538,7 +553,7 @@ void Con_DrawConsole( void ) { Con_CheckResize (); // if disconnected, render console full screen - if ( cls.state == CA_DISCONNECTED ) { + if ( clc.state == CA_DISCONNECTED ) { if ( !( Key_GetCatcher( ) & (KEYCATCH_UI | KEYCATCH_CGAME)) ) { Con_DrawSolidConsole( 1.0 ); return; -- cgit