Browse Source

engine: client: fix missing HTTP_ResetProcessState call

pull/2/head
Alibek Omarov 1 year ago
parent
commit
48988e66bd
  1. 9
      engine/client/cl_parse.c
  2. 1
      engine/client/client.h
  3. 1
      engine/common/net_ws.h

9
engine/client/cl_parse.c

@ -587,7 +587,7 @@ int CL_EstimateNeededResources( void )
return nTotalSize; return nTotalSize;
} }
void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom ) static void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom )
{ {
resourceinfo_t ri; resourceinfo_t ri;
@ -603,6 +603,8 @@ void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom )
} }
else else
{ {
HTTP_ResetProcessState();
cls.state = ca_validate; cls.state = ca_validate;
cls.dl.custom = false; cls.dl.custom = false;
} }
@ -2665,15 +2667,14 @@ CL_ParseResourceList
void CL_LegacyParseResourceList( sizebuf_t *msg ) void CL_LegacyParseResourceList( sizebuf_t *msg )
{ {
int i = 0; int i = 0;
static struct static struct
{ {
int rescount; int rescount;
int restype[MAX_LEGACY_RESOURCES]; int restype[MAX_LEGACY_RESOURCES];
char resnames[MAX_LEGACY_RESOURCES][MAX_QPATH]; char resnames[MAX_LEGACY_RESOURCES][MAX_QPATH];
} reslist; } reslist;
memset( &reslist, 0, sizeof( reslist ));
memset( &reslist, 0, sizeof( reslist ));
reslist.rescount = MSG_ReadWord( msg ) - 1; reslist.rescount = MSG_ReadWord( msg ) - 1;
if( reslist.rescount > MAX_LEGACY_RESOURCES ) if( reslist.rescount > MAX_LEGACY_RESOURCES )
@ -2690,6 +2691,8 @@ void CL_LegacyParseResourceList( sizebuf_t *msg )
return; return;
} }
HTTP_ResetProcessState();
host.downloadcount = 0; host.downloadcount = 0;
for( i = 0; i < reslist.rescount; i++ ) for( i = 0; i < reslist.rescount; i++ )

1
engine/client/client.h

@ -892,7 +892,6 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message );
void CL_LegacyPrecache_f( void ); void CL_LegacyPrecache_f( void );
void CL_ParseTempEntity( sizebuf_t *msg ); 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_DispatchUserMessage( const char *pszName, int iSize, void *pbuf );
qboolean CL_RequestMissingResources( void ); qboolean CL_RequestMissingResources( void );
void CL_RegisterResources ( sizebuf_t *msg ); void CL_RegisterResources ( sizebuf_t *msg );

1
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_AddDownload( const char *path, int size, qboolean process );
void HTTP_ClearCustomServers( void ); void HTTP_ClearCustomServers( void );
void HTTP_Shutdown( void ); void HTTP_Shutdown( void );
void HTTP_ResetProcessState( void );
void HTTP_Init( void ); void HTTP_Init( void );
void HTTP_Run( void ); void HTTP_Run( void );

Loading…
Cancel
Save