Make sure to pop the loading screen on error
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s

This fixes the client getting stuck in the loading screen due to a drop error
This commit is contained in:
smallmodel 2024-12-08 18:47:10 +01:00 committed by GitHub
parent a08a9a4f10
commit f684349c18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 14 deletions

View file

@ -62,6 +62,9 @@ void CL_CharEvent( int key ) {
void CL_Disconnect() {
}
void CL_AbnormalDisconnect() {
}
void CL_MapLoading( qboolean flush, const char *pszMapName ) {
}

View file

@ -419,30 +419,40 @@ void QDECL Com_Error( int code, const char *fmt, ... ) {
Cvar_Set("com_errorMessage", com_errorMessage);
if (code == ERR_DISCONNECT || code == ERR_SERVERDISCONNECT) {
CL_Disconnect();
CL_FlushMemory( );
if (com_cl_running && com_cl_running->integer) {
CL_AbnormalDisconnect();
CL_FlushMemory();
CL_StartHunkUsers(qfalse);
} else {
SV_Shutdown(va("Server disconnected: %s", com_errorMessage));
}
// make sure we can get at our local stuff
FS_PureServerSetLoadedPaks("", "");
com_errorEntered = qfalse;
longjmp (abortframe, -1);
} else if (code == ERR_DROP) {
Com_Printf ("********************\nERROR: %s\n********************\n", com_errorMessage);
SV_Shutdown (va("Server crashed: %s", com_errorMessage));
CL_Disconnect();
CL_FlushMemory( );
SV_Shutdown(va("Server crashed: %s", com_errorMessage));
#ifndef DEDICATED
if (com_cl_running && com_cl_running->integer) {
CL_AbnormalDisconnect();
CL_FlushMemory();
CL_StartHunkUsers(qfalse);
}
#endif
FS_PureServerSetLoadedPaks("", "");
com_errorEntered = qfalse;
longjmp (abortframe, -1);
} else if ( code == ERR_NEED_CD ) {
SV_Shutdown( "Server didn't have CD" );
if ( com_cl_running && com_cl_running->integer ) {
CL_Disconnect();
CL_FlushMemory( );
com_errorEntered = qfalse;
CL_CDDialog();
} else {
Com_Printf("Server didn't have CD\n" );
}
SV_Shutdown("Server didn't have CD");
if (com_cl_running && com_cl_running->integer) {
CL_Disconnect();
CL_FlushMemory();
com_errorEntered = qfalse;
CL_CDDialog();
} else {
Com_Printf("Server didn't have CD\n");
}
FS_PureServerSetLoadedPaks("", "");
longjmp (abortframe, -1);
} else {

View file

@ -1181,6 +1181,7 @@ void CL_InitKeyCommands( void );
void CL_Init( void );
void CL_Disconnect();
void CL_AbnormalDisconnect();
void CL_Shutdown(const char *finalmsg, qboolean disconnect, qboolean quit);
qboolean CL_FinishedIntro(void);
void CL_FinishedStartStage(void);