/* ================ Sys_Break same as Error ================ */ void Sys_Break( const char *error, ... ) { va_list argptr; char text[MAX_SYSPATH]; if( host.state == HOST_ERR_FATAL ) return; // don't multiple executes error_on_exit = true; host.state = HOST_ERR_FATAL; va_start( argptr, error ); Q_vsprintf( text, error, argptr ); va_end( argptr ); if( host.type == HOST_NORMAL ) { if( host.hWnd ) ShowWindow( host.hWnd, SW_HIDE ); VID_RestoreGamma(); } if( host.type != HOST_NORMAL || host.developer > 0 ) { Con_ShowConsole( true ); Con_DisableInput(); // disable input line for dedicated server Sys_Print( text ); Sys_WaitForQuit(); } else { Con_ShowConsole( false ); MSGBOX( text ); } Sys_Quit(); }
/* ================ Sys_Error NOTE: we must prepare engine to shutdown before call this ================ */ void Sys_Error( const char *format, ... ) { va_list argptr; char text[MAX_SYSPATH]; DEBUG_BREAK; if( host.state == HOST_ERR_FATAL ) return; // don't execute more than once // make sure that console received last message if( host.change_game ) Sys_Sleep( 200 ); error_on_exit = true; host.state = HOST_ERR_FATAL; va_start( argptr, format ); Q_vsprintf( text, format, argptr ); va_end( argptr ); SV_SysError( text ); if( !Host_IsDedicated() ) { #ifdef XASH_SDL if( host.hWnd ) SDL_HideWindow( host.hWnd ); #endif VID_RestoreGamma(); } if( host.developer > 0 ) { Con_ShowConsole( true ); Con_DisableInput(); // disable input line for dedicated server Sys_Print( text ); // print error message MSGBOX( text ); Sys_WaitForQuit(); } else { Con_ShowConsole( false ); MSGBOX( text ); } Sys_Quit(); }
/* ================ Sys_Error NOTE: we must prepare engine to shutdown before call this ================ */ void Sys_Error( const char *error, ... ) { va_list argptr; char text[MAX_SYSPATH]; if( host.state == HOST_ERR_FATAL ) return; // don't multiple executes // make sure what console received last message if( host.change_game ) Sys_Sleep( 200 ); error_on_exit = true; host.state = HOST_ERR_FATAL; va_start( argptr, error ); Q_vsprintf( text, error, argptr ); va_end( argptr ); SV_SysError( text ); if( host.type == HOST_NORMAL ) { if( host.hWnd ) ShowWindow( host.hWnd, SW_HIDE ); VID_RestoreGamma(); } if( host.developer > 0 ) { Con_ShowConsole( true ); Con_DisableInput(); // disable input line for dedicated server Sys_Print( text ); // print error message Sys_WaitForQuit(); } else { Con_ShowConsole( false ); MSGBOX( text ); } Sys_Quit(); }
/* ================ Sys_Break same as Error ================ */ void Sys_Break( const char *format, ... ) { va_list argptr; char text[MAX_SYSPATH]; DEBUG_BREAK; if( host.state == HOST_ERR_FATAL ) return; // don't multiple executes error_on_exit = true; host.state = HOST_ERR_FATAL; va_start( argptr, format ); Q_vsprintf( text, format, argptr ); va_end( argptr ); if( !Host_IsDedicated() ) { #ifdef XASH_SDL if( host.hWnd ) SDL_HideWindow( host.hWnd ); #endif VID_RestoreGamma(); } if( Host_IsDedicated() || host.developer > 0 ) { Con_ShowConsole( true ); Con_DisableInput(); // disable input line for dedicated server Sys_Print( text ); MSGBOX( text ); Sys_WaitForQuit(); } else { Con_ShowConsole( false ); MSGBOX( text ); } Sys_Quit(); }