From 48988e66bd7cd59c867377f426c63ea1ff462db9 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 3 Apr 2023 03:11:39 +0300 Subject: [PATCH] engine: client: fix missing HTTP_ResetProcessState call --- engine/client/cl_parse.c | 9 ++++++--- engine/client/client.h | 1 - engine/common/net_ws.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 4c236725..ebacd015 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -587,7 +587,7 @@ int CL_EstimateNeededResources( void ) return nTotalSize; } -void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom ) +static void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom ) { resourceinfo_t ri; @@ -603,6 +603,8 @@ void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom ) } else { + HTTP_ResetProcessState(); + cls.state = ca_validate; cls.dl.custom = false; } @@ -2665,15 +2667,14 @@ CL_ParseResourceList void CL_LegacyParseResourceList( sizebuf_t *msg ) { int i = 0; - static struct { int rescount; int restype[MAX_LEGACY_RESOURCES]; char resnames[MAX_LEGACY_RESOURCES][MAX_QPATH]; } reslist; - memset( &reslist, 0, sizeof( reslist )); + memset( &reslist, 0, sizeof( reslist )); reslist.rescount = MSG_ReadWord( msg ) - 1; if( reslist.rescount > MAX_LEGACY_RESOURCES ) @@ -2690,6 +2691,8 @@ void CL_LegacyParseResourceList( sizebuf_t *msg ) return; } + HTTP_ResetProcessState(); + host.downloadcount = 0; for( i = 0; i < reslist.rescount; i++ ) diff --git a/engine/client/client.h b/engine/client/client.h index 0275fc5e..32bb57d4 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -892,7 +892,6 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message ); void CL_LegacyPrecache_f( void ); void CL_ParseTempEntity( sizebuf_t *msg ); -void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom ); qboolean CL_DispatchUserMessage( const char *pszName, int iSize, void *pbuf ); qboolean CL_RequestMissingResources( void ); void CL_RegisterResources ( sizebuf_t *msg ); diff --git a/engine/common/net_ws.h b/engine/common/net_ws.h index f45851e5..d45db4fb 100644 --- a/engine/common/net_ws.h +++ b/engine/common/net_ws.h @@ -89,6 +89,7 @@ void HTTP_AddCustomServer( const char *url ); void HTTP_AddDownload( const char *path, int size, qboolean process ); void HTTP_ClearCustomServers( void ); void HTTP_Shutdown( void ); +void HTTP_ResetProcessState( void ); void HTTP_Init( void ); void HTTP_Run( void );