summaryrefslogtreecommitdiff
path: root/source/files.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-01-10 22:09:39 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-01-10 22:09:39 +0000
commit6fd8535eefc7e324849016d4fbb06e6488778c8b (patch)
tree682cf66b3ad1c47d1b22cd418a621f00bf7ba518 /source/files.c
parentfef9f789590b48cd5a6438ebfbefe84ce4b85115 (diff)
Always send nonzero areabytes to non-q2pro clients
(fixes hall of mirrors in MVD Waiting Room). Made `deathmatch' and `maxclients' default to `1' and `8' respectively. Made autocompletion work for some console variables too. Made `set' command accept multiple args with spaces, as well as Cvar_Command. Fixed potential crash on entities with EF_BFG bit and out of range skinnum. Levelshots work again now. Made `pingservers' command ping all 64 possible servers. Delete scrap texture on refresh shutdown. Added `leave' command for GTV, switches client to Waiting Room.
Diffstat (limited to 'source/files.c')
-rw-r--r--source/files.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source/files.c b/source/files.c
index 02f59e2..3ba6aed 100644
--- a/source/files.c
+++ b/source/files.c
@@ -1058,18 +1058,22 @@ int FS_LoadFileEx( const char *path, void **buffer, int flags ) {
return -1;
}
- // get real file length
- length = FS_GetFileLength( f );
-
- if( buffer && length != -1 ) {
- *buffer = buf = FS_AllocTempMem( length + 1 );
- FS_Read( buf, length, f );
- buf[length] = 0;
+ if( buffer ) {
+#if USE_ZLIB
+ if( file->type == FS_GZIP ) {
+ length = -1; // unknown length
+ } else
+#endif
+ {
+ *buffer = buf = FS_AllocTempMem( length + 1 );
+ FS_Read( buf, length, f );
+ buf[length] = 0;
+ }
}
FS_FCloseFile( f );
- return length == -1 ? 0 : length;
+ return length;
}
int FS_LoadFile( const char *path, void **buffer ) {
@@ -2437,7 +2441,6 @@ Sets the gamedir and path to a different directory.
*/
static void FS_SetupGamedir( void ) {
fs_game = Cvar_Get( "game", "", CVAR_LATCHED|CVAR_SERVERINFO );
- fs_game->subsystem = CVAR_SYSTEM_FILES;
if( !fs_game->string[0] || !FS_strcmp( fs_game->string, BASEGAME ) ) {
FS_DefaultGamedir();
@@ -2604,7 +2607,6 @@ void FS_Init( void ) {
fs_debug = Cvar_Get( "fs_debug", "0", 0 );
fs_restrict_mask = Cvar_Get( "fs_restrict_mask", "4", CVAR_NOSET );
- fs_restrict_mask->subsystem = CVAR_SYSTEM_FILES;
if( ( fs_restrict_mask->integer & 7 ) == 7 ) {
Com_WPrintf( "Invalid fs_restrict_mask value %d. "