added .shader to the pure client file read exception list

This commit is contained in:
myT 2019-03-29 23:34:37 +01:00
parent 08b5d6bf57
commit baa6eb2cc4
2 changed files with 16 additions and 11 deletions

View file

@ -40,6 +40,8 @@ chg: faster map loads by limiting the rendering back-end's frame-rate
chg: on Windows, the upper limit of open stdio file handles was raised from 512 to 2048 chg: on Windows, the upper limit of open stdio file handles was raised from 512 to 2048
fix: the presence of .shader files outside of PK3s no longer triggers a drop error
fix: shader stage collapsing was happening in cases where it would yield incorrect results fix: shader stage collapsing was happening in cases where it would yield incorrect results
fix: map download improvements fix: map download improvements

View file

@ -837,19 +837,22 @@ qbool FS_FilenameCompare( const char *s1, const char *s2 ) {
static qbool FS_IsPureClientReadException( const char* filename ) static qbool FS_IsPureClientReadException( const char* filename )
{ {
const int l = strlen( filename ); static const char* extensions[] = { ".cfg", ".ttf", ".dat", ".jpg", ".jpeg", ".tga", ".png", ".shader" };
if ( l < 5 ) const int shortestExtLength = 3;
const int nameLength = strlen(filename);
if (nameLength < shortestExtLength + 2)
return qfalse; return qfalse;
const char* const s4 = filename + l - 4; for (int i = 0; i < ARRAY_LEN(extensions); ++i) {
const char* const s5 = filename + l - 5; const char* const ext = extensions[i];
return !Q_stricmp( s4, ".cfg" ) || const int extLength = strlen(ext);
!Q_stricmp( s4, ".ttf" ) ||
!Q_stricmp( s4, ".dat" ) || if (nameLength > extLength && !Q_strncmp(filename + nameLength - extLength, ext, extLength))
!Q_stricmp( s4, ".jpg" ) || return qtrue;
!Q_stricmp( s4, ".tga" ) || }
!Q_stricmp( s4, ".png" ) ||
!Q_stricmp( s5, ".jpeg" ); return qfalse;
} }