diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 52e0ed7d..2e17c970 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -144,6 +144,8 @@ int serverStatusCount; void hA3Dg_ExportRenderGeom (refexport_t *incoming_re); #endif +static int isQuitting = qfalse; + extern void SV_BotFrame( int time ); void CL_CheckForResend( void ); void CL_ShowIP_f(void); @@ -1472,7 +1474,9 @@ void CL_Disconnect( qboolean showMainMenu ) { } CL_UpdateGUID( NULL, 0 ); - CL_OldGame(); + + if(!isQuitting) + CL_OldGame(); } @@ -3630,7 +3634,7 @@ CL_Shutdown =============== */ -void CL_Shutdown(char *finalmsg, qboolean disconnect) +void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit) { static qboolean recursive = qfalse; @@ -3646,6 +3650,8 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect) } recursive = qtrue; + isQuitting = quit; + if(disconnect) CL_Disconnect(qtrue); @@ -3675,7 +3681,6 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect) Cmd_RemoveCommand ("model"); Cmd_RemoveCommand ("video"); Cmd_RemoveCommand ("stopvideo"); - Cmd_RemoveCommand ("minimize"); CL_ShutdownInput(); Con_Shutdown(); diff --git a/code/null/null_client.c b/code/null/null_client.c index 386cf076..64ceb1e6 100644 --- a/code/null/null_client.c +++ b/code/null/null_client.c @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA cvar_t *cl_shownet; -void CL_Shutdown(char *finalmsg, qboolean disconnect) +void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit) { } diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 06dbb798..0e585c04 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -333,8 +333,8 @@ void QDECL Com_Error( int code, const char *fmt, ... ) { longjmp (abortframe, -1); } else { VM_Forced_Unload_Start(); - CL_Shutdown (va("Client fatal crashed: %s", com_errorMessage), qtrue); - SV_Shutdown (va("Server fatal crashed: %s", com_errorMessage)); + CL_Shutdown(va("Client fatal crashed: %s", com_errorMessage), qtrue, qtrue); + SV_Shutdown(va("Server fatal crashed: %s", com_errorMessage)); VM_Forced_Unload_Done(); } @@ -361,8 +361,8 @@ void Com_Quit_f( void ) { // Sys_Quit will kill this process anyways, so // a corrupt call stack makes no difference VM_Forced_Unload_Start(); - SV_Shutdown (p[0] ? p : "Server quit"); - CL_Shutdown (p[0] ? p : "Client quit", qtrue); + SV_Shutdown(p[0] ? p : "Server quit"); + CL_Shutdown(p[0] ? p : "Client quit", qtrue, qtrue); VM_Forced_Unload_Done(); Com_Shutdown (); FS_Shutdown(qtrue); @@ -2411,7 +2411,7 @@ void Com_GameRestart(int checksumFeed, qboolean disconnect) if(disconnect) CL_Disconnect(qfalse); - CL_Shutdown("Game directory changed", disconnect); + CL_Shutdown("Game directory changed", disconnect, qfalse); } FS_Restart(checksumFeed); diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h index 4a6410d4..43215db3 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h @@ -974,7 +974,7 @@ void CL_InitKeyCommands( void ); void CL_Init( void ); void CL_Disconnect( qboolean showMainMenu ); -void CL_Shutdown(char *finalmsg, qboolean disconnect); +void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit); void CL_Frame( int msec ); qboolean CL_GameCommand( void ); void CL_KeyEvent (int key, qboolean down, unsigned time); diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c index e3880d9e..2b239d87 100644 --- a/code/renderer/tr_init.c +++ b/code/renderer/tr_init.c @@ -1250,6 +1250,7 @@ void RE_Shutdown( qboolean destroyWindow ) { ri.Cmd_RemoveCommand ("shaderlist"); ri.Cmd_RemoveCommand ("skinlist"); ri.Cmd_RemoveCommand ("gfxinfo"); + ri.Cmd_RemoveCommand("minimize"); ri.Cmd_RemoveCommand( "modelist" ); ri.Cmd_RemoveCommand( "shaderstate" ); diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c index 3f440aa9..67861163 100644 --- a/code/sys/sys_main.c +++ b/code/sys/sys_main.c @@ -550,7 +550,7 @@ void Sys_SigHandler( int signal ) { signalcaught = qtrue; #ifndef DEDICATED - CL_Shutdown(va("Received signal %d", signal), qtrue); + CL_Shutdown(va("Received signal %d", signal), qtrue, qtrue); #endif SV_Shutdown(va("Received signal %d", signal) ); }