Skip to content

Commit

Permalink
Server crash can cause recursive call to Com_Error, too
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilo Schulz committed Feb 2, 2011
1 parent 4982bf8 commit 16c83ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/qcommon/common.c
Expand Up @@ -287,9 +287,9 @@ void QDECL Com_Error( int code, const char *fmt, ... ) {
Cvar_Set("com_errorMessage", com_errorMessage);

if (code == ERR_DISCONNECT || code == ERR_SERVERDISCONNECT) {
VM_Forced_Unload_Start();
SV_Shutdown( "Server disconnected" );
CL_Disconnect( qtrue );
VM_Forced_Unload_Start();
CL_FlushMemory( );
VM_Forced_Unload_Done();
// make sure we can get at our local stuff
Expand All @@ -298,32 +298,36 @@ void QDECL Com_Error( int code, const char *fmt, ... ) {
longjmp (abortframe, -1);
} else if (code == ERR_DROP) {
Com_Printf ("********************\nERROR: %s\n********************\n", com_errorMessage);
VM_Forced_Unload_Start();
SV_Shutdown (va("Server crashed: %s", com_errorMessage));
CL_Disconnect( qtrue );
VM_Forced_Unload_Start();
CL_FlushMemory( );
VM_Forced_Unload_Done();
FS_PureServerSetLoadedPaks("", "");
com_errorEntered = qfalse;
longjmp (abortframe, -1);
} else if ( code == ERR_NEED_CD ) {
VM_Forced_Unload_Start();
SV_Shutdown( "Server didn't have CD" );
if ( com_cl_running && com_cl_running->integer ) {
CL_Disconnect( qtrue );
VM_Forced_Unload_Start();
CL_FlushMemory( );
VM_Forced_Unload_Done();
CL_CDDialog();
} else {
Com_Printf("Server didn't have CD\n" );
VM_Forced_Unload_Done();
}

FS_PureServerSetLoadedPaks("", "");

com_errorEntered = qfalse;
longjmp (abortframe, -1);
} else {
VM_Forced_Unload_Start();
CL_Shutdown (va("Client fatal crashed: %s", com_errorMessage));
SV_Shutdown (va("Server fatal crashed: %s", com_errorMessage));
VM_Forced_Unload_Done();
}

Com_Shutdown ();
Expand Down

0 comments on commit 16c83ae

Please sign in to comment.