- Fix already defined command warnings for minimize

- Fix recursive CL_Shutdown warning and "command already defined" warnings when quitting while playing on a server that changed the gamedir.
This commit is contained in:
Thilo Schulz 2011-08-01 10:16:40 +00:00
parent 404fe4e6e0
commit 8ab91bde8e
6 changed files with 17 additions and 11 deletions

View file

@ -144,6 +144,8 @@ int serverStatusCount;
void hA3Dg_ExportRenderGeom (refexport_t *incoming_re); void hA3Dg_ExportRenderGeom (refexport_t *incoming_re);
#endif #endif
static int isQuitting = qfalse;
extern void SV_BotFrame( int time ); extern void SV_BotFrame( int time );
void CL_CheckForResend( void ); void CL_CheckForResend( void );
void CL_ShowIP_f(void); void CL_ShowIP_f(void);
@ -1472,7 +1474,9 @@ void CL_Disconnect( qboolean showMainMenu ) {
} }
CL_UpdateGUID( NULL, 0 ); 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; static qboolean recursive = qfalse;
@ -3646,6 +3650,8 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect)
} }
recursive = qtrue; recursive = qtrue;
isQuitting = quit;
if(disconnect) if(disconnect)
CL_Disconnect(qtrue); CL_Disconnect(qtrue);
@ -3675,7 +3681,6 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect)
Cmd_RemoveCommand ("model"); Cmd_RemoveCommand ("model");
Cmd_RemoveCommand ("video"); Cmd_RemoveCommand ("video");
Cmd_RemoveCommand ("stopvideo"); Cmd_RemoveCommand ("stopvideo");
Cmd_RemoveCommand ("minimize");
CL_ShutdownInput(); CL_ShutdownInput();
Con_Shutdown(); Con_Shutdown();

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cvar_t *cl_shownet; cvar_t *cl_shownet;
void CL_Shutdown(char *finalmsg, qboolean disconnect) void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit)
{ {
} }

View file

@ -333,8 +333,8 @@ void QDECL Com_Error( int code, const char *fmt, ... ) {
longjmp (abortframe, -1); longjmp (abortframe, -1);
} else { } else {
VM_Forced_Unload_Start(); VM_Forced_Unload_Start();
CL_Shutdown (va("Client fatal crashed: %s", com_errorMessage), qtrue); CL_Shutdown(va("Client fatal crashed: %s", com_errorMessage), qtrue, qtrue);
SV_Shutdown (va("Server fatal crashed: %s", com_errorMessage)); SV_Shutdown(va("Server fatal crashed: %s", com_errorMessage));
VM_Forced_Unload_Done(); VM_Forced_Unload_Done();
} }
@ -361,8 +361,8 @@ void Com_Quit_f( void ) {
// Sys_Quit will kill this process anyways, so // Sys_Quit will kill this process anyways, so
// a corrupt call stack makes no difference // a corrupt call stack makes no difference
VM_Forced_Unload_Start(); VM_Forced_Unload_Start();
SV_Shutdown (p[0] ? p : "Server quit"); SV_Shutdown(p[0] ? p : "Server quit");
CL_Shutdown (p[0] ? p : "Client quit", qtrue); CL_Shutdown(p[0] ? p : "Client quit", qtrue, qtrue);
VM_Forced_Unload_Done(); VM_Forced_Unload_Done();
Com_Shutdown (); Com_Shutdown ();
FS_Shutdown(qtrue); FS_Shutdown(qtrue);
@ -2411,7 +2411,7 @@ void Com_GameRestart(int checksumFeed, qboolean disconnect)
if(disconnect) if(disconnect)
CL_Disconnect(qfalse); CL_Disconnect(qfalse);
CL_Shutdown("Game directory changed", disconnect); CL_Shutdown("Game directory changed", disconnect, qfalse);
} }
FS_Restart(checksumFeed); FS_Restart(checksumFeed);

View file

@ -974,7 +974,7 @@ void CL_InitKeyCommands( void );
void CL_Init( void ); void CL_Init( void );
void CL_Disconnect( qboolean showMainMenu ); 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 ); void CL_Frame( int msec );
qboolean CL_GameCommand( void ); qboolean CL_GameCommand( void );
void CL_KeyEvent (int key, qboolean down, unsigned time); void CL_KeyEvent (int key, qboolean down, unsigned time);

View file

@ -1250,6 +1250,7 @@ void RE_Shutdown( qboolean destroyWindow ) {
ri.Cmd_RemoveCommand ("shaderlist"); ri.Cmd_RemoveCommand ("shaderlist");
ri.Cmd_RemoveCommand ("skinlist"); ri.Cmd_RemoveCommand ("skinlist");
ri.Cmd_RemoveCommand ("gfxinfo"); ri.Cmd_RemoveCommand ("gfxinfo");
ri.Cmd_RemoveCommand("minimize");
ri.Cmd_RemoveCommand( "modelist" ); ri.Cmd_RemoveCommand( "modelist" );
ri.Cmd_RemoveCommand( "shaderstate" ); ri.Cmd_RemoveCommand( "shaderstate" );

View file

@ -550,7 +550,7 @@ void Sys_SigHandler( int signal )
{ {
signalcaught = qtrue; signalcaught = qtrue;
#ifndef DEDICATED #ifndef DEDICATED
CL_Shutdown(va("Received signal %d", signal), qtrue); CL_Shutdown(va("Received signal %d", signal), qtrue, qtrue);
#endif #endif
SV_Shutdown(va("Received signal %d", signal) ); SV_Shutdown(va("Received signal %d", signal) );
} }