summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-08-01 10:16:40 +0000
committerTim Angus <tim@ngus.net>2013-01-10 23:11:06 +0000
commit3afa3cecfe43264e09c07ab21518ed7fe0acba7d (patch)
tree3137f152498f6893b1bf7618e0ab5e5923de2e11 /src
parentc039c00ca0fe051f8ed243c08d238e739027cb76 (diff)
- 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.
Diffstat (limited to 'src')
-rw-r--r--src/client/cl_main.c11
-rw-r--r--src/null/null_client.c2
-rw-r--r--src/qcommon/common.c10
-rw-r--r--src/qcommon/qcommon.h2
-rw-r--r--src/renderer/tr_init.c1
-rw-r--r--src/sys/sys_main.c2
6 files changed, 17 insertions, 11 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 16f594ee..9e00bb6f 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -146,6 +146,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);
@@ -1473,7 +1475,9 @@ void CL_Disconnect( qboolean showMainMenu ) {
}
CL_UpdateGUID( NULL, 0 );
- CL_OldGame();
+
+ if(!isQuitting)
+ CL_OldGame();
}
@@ -3694,7 +3698,7 @@ CL_Shutdown
===============
*/
-void CL_Shutdown(char *finalmsg, qboolean disconnect)
+void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit)
{
static qboolean recursive = qfalse;
@@ -3710,6 +3714,8 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect)
}
recursive = qtrue;
+ isQuitting = quit;
+
if(disconnect)
CL_Disconnect(qtrue);
@@ -3739,7 +3745,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/src/null/null_client.c b/src/null/null_client.c
index cfb35c13..1755c0d4 100644
--- a/src/null/null_client.c
+++ b/src/null/null_client.c
@@ -26,7 +26,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/src/qcommon/common.c b/src/qcommon/common.c
index 01183da0..17ae4ee1 100644
--- a/src/qcommon/common.c
+++ b/src/qcommon/common.c
@@ -329,8 +329,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();
}
@@ -357,8 +357,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);
@@ -2407,7 +2407,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/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index 980d0cfb..16b54e33 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -946,7 +946,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/src/renderer/tr_init.c b/src/renderer/tr_init.c
index 6819b030..1ef9fde9 100644
--- a/src/renderer/tr_init.c
+++ b/src/renderer/tr_init.c
@@ -1259,6 +1259,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/src/sys/sys_main.c b/src/sys/sys_main.c
index b46e0d20..ea7fc0eb 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -551,7 +551,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) );
}