engine: get rid of host.crashed field, as it's a complete duplicate of host.status

This commit is contained in:
Alibek Omarov
2025-04-21 16:59:44 +03:00
parent 0e54200f34
commit c564cc96c7
8 changed files with 7 additions and 12 deletions

View File

@@ -3677,7 +3677,7 @@ void CL_Shutdown( void )
{
Con_Printf( "%s()\n", __func__ );
if( !host.crashed && cls.initialized )
if( host.status != HOST_CRASHED && cls.initialized )
{
Host_WriteOpenGLConfig ();
Host_WriteVideoConfig ();

View File

@@ -342,7 +342,6 @@ typedef struct host_parm_s
qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands
qboolean apply_opengl_config; // when true apply only to opengl cvars and ignore all other commands
qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc
qboolean crashed; // set to true if crashed
#if XASH_DLL_LOADER
qboolean enabledll;
#endif

View File

@@ -1355,7 +1355,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
#endif // XASH_ANDROID
// main window message loop
while( !host.crashed )
while( host.status != HOST_CRASHED )
{
newtime = Sys_DoubleTime ();
COM_Frame( newtime - oldtime );

View File

@@ -74,13 +74,12 @@ void Sys_Crash( int signal, siginfo_t *si, void *context )
#if !XASH_DEDICATED
IN_SetMouseGrab( false );
#endif
host.crashed = true;
host.status = HOST_CRASHED;
Platform_MessageBox( "Xash Error", message, false );
// log saved, now we can try to save configs and close log correctly, it may crash
if( host.type == HOST_NORMAL )
CL_Crashed();
host.status = HOST_CRASHED;
Sys_Quit( "crashed" );
}

View File

@@ -167,13 +167,12 @@ void Sys_CrashLibbacktrace( int signal, siginfo_t *si, void *context )
#if !XASH_DEDICATED
IN_SetMouseGrab( false );
#endif
host.crashed = true;
host.status = HOST_CRASHED;
Platform_MessageBox( "Xash Error", message, false );
// log saved, now we can try to save configs and close log correctly, it may crash
if( host.type == HOST_NORMAL )
CL_Crashed();
host.status = HOST_CRASHED;
Sys_Quit( "crashed" );
}

View File

@@ -196,13 +196,12 @@ void Sys_Crash( int signal, siginfo_t *si, void *context )
#if !XASH_DEDICATED
IN_SetMouseGrab( false );
#endif
host.crashed = true;
host.status = HOST_CRASHED;
Platform_MessageBox( "Xash Error", message, false );
// log saved, now we can try to save configs and close log correctly, it may crash
if( host.type == HOST_NORMAL )
CL_Crashed();
host.status = HOST_CRASHED;
Sys_Quit( "crashed" );
}

View File

@@ -549,7 +549,7 @@ void Platform_RunEvents( void )
{
SDL_Event event;
while( !host.crashed && !host.shutdown_issued && SDL_PollEvent( &event ) )
while( host.status != HOST_CRASHED && !host.shutdown_issued && SDL_PollEvent( &event ) )
SDLash_EventHandler( &event );
#if XASH_PSVITA

View File

@@ -270,7 +270,7 @@ static long _stdcall Sys_Crash( PEXCEPTION_POINTERS pInfo )
if( host.status != HOST_CRASHED )
{
// check to avoid recursive call
host.crashed = true;
host.status = HOST_CRASHED;
#if !XASH_DEDICATED
IN_SetMouseGrab( false );
@@ -302,7 +302,6 @@ static long _stdcall Sys_Crash( PEXCEPTION_POINTERS pInfo )
if( host.type == HOST_NORMAL )
CL_Crashed(); // tell client about crash
else host.status = HOST_CRASHED;
if( host_developer.value <= 0 )
{