pretty sucky, but that's how SoF did it...
| 1023 | */ |
| 1024 | void SG_WipeSavegame(const char *name); // pretty sucky, but that's how SoF did it...<g> |
| 1025 | static 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 | ================= |
no test coverage detected