diff options
Diffstat (limited to 'src/qcommon/common.c')
-rw-r--r-- | src/qcommon/common.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/qcommon/common.c b/src/qcommon/common.c index d9fb4495..38902e92 100644 --- a/src/qcommon/common.c +++ b/src/qcommon/common.c @@ -82,6 +82,7 @@ cvar_t *com_unfocused; cvar_t *com_maxfpsUnfocused; cvar_t *com_minimized; cvar_t *com_maxfpsMinimized; +cvar_t *com_abnormalExit; // com_speeds times int time_game; @@ -238,7 +239,7 @@ void QDECL Com_DPrintf( const char *fmt, ...) { Com_Error Both client and server can use this, and it will -do the apropriate things. +do the appropriate thing. ============= */ void QDECL Com_Error( int code, const char *fmt, ... ) { @@ -323,7 +324,7 @@ void QDECL Com_Error( int code, const char *fmt, ... ) { com_errorEntered = qfalse; longjmp (abortframe, -1); } else { - CL_Shutdown (); + CL_Shutdown (va("Client fatal crashed: %s", com_errorMessage)); SV_Shutdown (va("Server fatal crashed: %s", com_errorMessage)); } @@ -347,7 +348,7 @@ void Com_Quit_f( void ) { char *p = Cmd_Args( ); if ( !com_errorEntered ) { SV_Shutdown (p[0] ? p : "Server quit"); - CL_Shutdown (); + CL_Shutdown (p[0] ? p : "Client quit"); Com_Shutdown (); FS_Shutdown(qtrue); } @@ -2616,12 +2617,25 @@ void Com_Init( char *commandLine ) { com_maxfpsUnfocused = Cvar_Get( "com_maxfpsUnfocused", "0", CVAR_ARCHIVE ); com_minimized = Cvar_Get( "com_minimized", "0", CVAR_ROM ); com_maxfpsMinimized = Cvar_Get( "com_maxfpsMinimized", "0", CVAR_ARCHIVE ); + com_abnormalExit = Cvar_Get( "com_abnormalExit", "0", CVAR_ROM ); s = va("%s %s %s", Q3_VERSION, PLATFORM_STRING, __DATE__ ); com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO ); Sys_Init(); + if( Sys_WritePIDFile( ) ) { +#ifndef DEDICATED + const char *message = "The last time " CLIENT_WINDOW_TITLE " ran, " + "it didn't exit properly. This may be due to inappropriate video " + "settings. Would you like to start with \"safe\" video settings?"; + + if( Sys_Dialog( DT_YES_NO, message, "Abnormal Exit" ) == DR_YES ) { + Cvar_Set( "com_abnormalExit", "1" ); + } +#endif + } + // Pick a random port value Com_RandomBytes( (byte*)&qport, sizeof(int) ); Netchan_Init( qport & 0xffff ); |