Reduce duplication in FS path search code

Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
This commit is contained in:
Tim Angusandsmallmodel authored and smallmodel committed 2025-09-04 23:28:07 +02:00
1 parent eb6b6173ee
commit e299031470
12 files changed
+347 -383

No files matched your search

+2 -2
View File
@@ -609,7 +609,7 @@ static void SV_RehashBans_f(void)
Com_sprintf(filepath, sizeof(filepath), "%s/%s", FS_GetCurrentGameDir(), sv_banFile->string);
if((filelen = FS_SV_FOpenFileRead(filepath, &readfrom)) >= 0)
if((filelen = FS_BaseDir_FOpenFileRead(filepath, &readfrom)) >= 0)
{
if(filelen < 2)
{
@@ -705,7 +705,7 @@ static void SV_WriteBans(void)
Com_sprintf(filepath, sizeof(filepath), "%s/%s", FS_GetCurrentGameDir(), sv_banFile->string);
if((writeto = FS_SV_FOpenFileWrite(filepath)))
if((writeto = FS_BaseDir_FOpenFileWrite(filepath)))
{
char writebuf[128 + MAX_REASON_LENGTH];
serverBan_t *curban;
+1 -1
View File
@@ -1088,7 +1088,7 @@ int SV_WriteDownloadToClient(client_t *cl, msg_t *msg)
if ( !(sv_allowDownload->integer & DLF_ENABLE) ||
(sv_allowDownload->integer & DLF_NO_UDP) ||
idPack || unreferenced ||
( cl->downloadSize = FS_SV_FOpenFileRead( cl->downloadName, &cl->download ) ) < 0 ) {
( cl->downloadSize = FS_BaseDir_FOpenFileRead( cl->downloadName, &cl->download ) ) < 0 ) {
// cannot auto-download file
if(unreferenced)
{