mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-02-21 11:21:32 +00:00
sv_pure 1 now allows new image files (no overrides) to be read from directories
very useful for CPMA's SuperHUD
This commit is contained in:
parent
d167150e19
commit
7020abd4a8
2 changed files with 29 additions and 11 deletions
|
@ -111,6 +111,8 @@ add: 64-bit support
|
||||||
|
|
||||||
chg: new system requirements: OpenGL 2, SDL 2 on the Linux client, Windows Vista or later
|
chg: new system requirements: OpenGL 2, SDL 2 on the Linux client, Windows Vista or later
|
||||||
|
|
||||||
|
chg: sv_pure 1 now allows new image files (no overrides) to be read from directories
|
||||||
|
|
||||||
chg: now ignoring q3config.cfg and autoexec.cfg outside fs_game to avoid config poisoning
|
chg: now ignoring q3config.cfg and autoexec.cfg outside fs_game to avoid config poisoning
|
||||||
|
|
||||||
chg: removed the r_maplight* cvars
|
chg: removed the r_maplight* cvars
|
||||||
|
|
|
@ -834,6 +834,26 @@ qbool FS_FilenameCompare( const char *s1, const char *s2 ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// returns qtrue if we allow opening the file on the real file system
|
||||||
|
|
||||||
|
static qbool FS_IsPureException( const char* filename )
|
||||||
|
{
|
||||||
|
const int l = strlen( filename );
|
||||||
|
if ( l < 5 )
|
||||||
|
return qfalse;
|
||||||
|
|
||||||
|
const char* const s4 = filename + l - 4;
|
||||||
|
const char* const s5 = filename + l - 5;
|
||||||
|
return !Q_stricmp( s4, ".cfg" ) ||
|
||||||
|
!Q_stricmp( s4, ".ttf" ) ||
|
||||||
|
!Q_stricmp( s4, ".dat" ) ||
|
||||||
|
!Q_stricmp( s4, ".jpg" ) ||
|
||||||
|
!Q_stricmp( s4, ".tga" ) ||
|
||||||
|
!Q_stricmp( s4, ".png" ) ||
|
||||||
|
!Q_stricmp( s5, ".jpeg" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===========
|
===========
|
||||||
FS_FOpenFileRead
|
FS_FOpenFileRead
|
||||||
|
@ -857,6 +877,7 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qbool uniqueFILE
|
||||||
FILE *temp;
|
FILE *temp;
|
||||||
int l;
|
int l;
|
||||||
char demoExt[16];
|
char demoExt[16];
|
||||||
|
qbool pureException;
|
||||||
|
|
||||||
hash = 0;
|
hash = 0;
|
||||||
|
|
||||||
|
@ -1025,19 +1046,16 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qbool uniqueFILE
|
||||||
|
|
||||||
// if we are running restricted, the only files we
|
// if we are running restricted, the only files we
|
||||||
// will allow to come from the directory are .cfg files
|
// will allow to come from the directory are .cfg files
|
||||||
l = strlen( filename );
|
|
||||||
// FIXME TTimo I'm not sure about the fs_numServerPaks test
|
// FIXME TTimo I'm not sure about the fs_numServerPaks test
|
||||||
// if you are using FS_ReadFile to find out if a file exists,
|
// if you are using FS_ReadFile to find out if a file exists,
|
||||||
// this test can make the search fail although the file is in the directory
|
// this test can make the search fail although the file is in the directory
|
||||||
// I had the problem on https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=8
|
// I had the problem on https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=8
|
||||||
// turned out I used FS_FileExists instead
|
// turned out I used FS_FileExists instead
|
||||||
if ( fs_numServerPaks ) {
|
pureException = FS_IsPureException( filename );
|
||||||
if ( Q_stricmp( filename + l - 4, ".cfg" )
|
if ( fs_numServerPaks && !pureException ) {
|
||||||
&& Q_stricmp( filename + l - 4, ".ttf" )
|
|
||||||
&& Q_stricmp( filename + l - 4, ".dat" ) ) { // for journal files
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
dir = search->dir;
|
dir = search->dir;
|
||||||
|
|
||||||
|
@ -1047,9 +1065,7 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qbool uniqueFILE
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Q_stricmp( filename + l - 4, ".cfg" )
|
if ( !pureException ) {
|
||||||
&& Q_stricmp( filename + l - 4, ".ttf" )
|
|
||||||
&& Q_stricmp( filename + l - 4, ".dat" ) ) { // for journal files
|
|
||||||
fs_fakeChkSum = 0;
|
fs_fakeChkSum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue