MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Com_CatchError

Function Com_CatchError

code/qcommon/common.cpp:1025–1044  ·  view source on GitHub ↗

pretty sucky, but that's how SoF did it...

Source from the content-addressed store, hash-verified

1023*/
1024void SG_WipeSavegame(const char *name); // pretty sucky, but that's how SoF did it...<g>
1025static void Com_CatchError ( int code )
1026{
1027 if ( code == ERR_DISCONNECT ) {
1028 SV_Shutdown( "Server disconnected" );
1029 CL_Disconnect( );
1030 CL_FlushMemory( );
1031 com_errorEntered = qfalse;
1032 } else if ( code == ERR_DROP ) {
1033 // If loading/saving caused the crash/error - delete the temp file
1034 SG_WipeSavegame("current"); // delete file
1035
1036 Com_Printf ("********************\n"
1037 "ERROR: %s\n"
1038 "********************\n", com_errorMessage);
1039 SV_Shutdown (va("Server crashed: %s\n", com_errorMessage));
1040 CL_Disconnect( );
1041 CL_FlushMemory( );
1042 com_errorEntered = qfalse;
1043 }
1044}
1045
1046/*
1047=================

Callers 2

Com_InitFunction · 0.70
Com_FrameFunction · 0.70

Calls 6

SG_WipeSavegameFunction · 0.85
Com_PrintfFunction · 0.70
vaFunction · 0.70
SV_ShutdownFunction · 0.50
CL_DisconnectFunction · 0.50
CL_FlushMemoryFunction · 0.50

Tested by

no test coverage detected