engine: allow to change hardcoded path to custom.hpk

This commit is contained in:
Alibek Omarov
2024-06-15 17:05:52 +03:00
parent 1b36785177
commit 95b48da37d
12 changed files with 25 additions and 25 deletions

View File

@@ -2157,9 +2157,9 @@ static qboolean SV_DownloadFile_f( sv_client_t *cl )
memset( &custResource, 0, sizeof( custResource ) );
COM_HexConvert( name + 4, 32, md5 );
if( HPAK_ResourceForHash( CUSTOM_RES_PATH, md5, &custResource ))
if( HPAK_ResourceForHash( hpk_custom_file.string, md5, &custResource ))
{
if( HPAK_GetDataPointer( CUSTOM_RES_PATH, &custResource, &pbuf, &size ))
if( HPAK_GetDataPointer( hpk_custom_file.string, &custResource, &pbuf, &size ))
{
if( size )
{

View File

@@ -298,7 +298,7 @@ static qboolean SV_CheckFile( sizebuf_t *msg, const char *filename )
{
COM_HexConvert( filename + 4, 32, p.rgucMD5_hash );
if( HPAK_GetDataPointer( CUSTOM_RES_PATH, &p, NULL, NULL ))
if( HPAK_GetDataPointer( hpk_custom_file.string, &p, NULL, NULL ))
return true;
}
@@ -393,7 +393,7 @@ int SV_EstimateNeededResources( sv_client_t *cl )
if( p->type != t_decal )
continue;
if( !HPAK_ResourceForHash( CUSTOM_RES_PATH, p->rgucMD5_hash, NULL ))
if( !HPAK_ResourceForHash( hpk_custom_file.string, p->rgucMD5_hash, NULL ))
{
if( p->nDownloadSize != 0 )
{

View File

@@ -1069,8 +1069,8 @@ qboolean SV_SpawnServer( const char *mapname, const char *startspot, qboolean ba
current_skill = bound( 0, current_skill, 3 );
Cvar_SetValue( "skill", (float)current_skill );
// enforce hpk_maxsize
HPAK_CheckSize( CUSTOM_RES_PATH );
// enforce hpk_max_size
HPAK_CheckSize( hpk_custom_file.string );
// force normal player collisions for single player
if( svs.maxclients == 1 )

View File

@@ -338,7 +338,7 @@ static void SV_ProcessFile( sv_client_t *cl, const char *filename )
return;
}
HPAK_AddLump( true, CUSTOM_RES_PATH, resource, cl->netchan.tempbuffer, NULL );
HPAK_AddLump( true, hpk_custom_file.string, resource, cl->netchan.tempbuffer, NULL );
ClearBits( resource->ucFlags, RES_WASMISSING );
SV_MoveToOnHandList( cl, resource );