From fd90f4f579c025667f3cca013a79d1f6169f8125 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sun, 11 Oct 2009 16:34:26 +0000 Subject: [PATCH] Fix fake checksum handling if client is unpure, make sure client does not remain unpure after FS_Restart. Thanks to /dev/humancontroller for reporting. http://bugzilla.icculus.org/show_bug.cgi?id=3605, thanks --- code/qcommon/files.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 7bbfc45d..7b4fc812 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1186,7 +1186,9 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF && Q_stricmp( filename + l - 5, ".game" ) // menu files && Q_stricmp( filename + l - strlen(demoExt), demoExt ) // menu files && Q_stricmp( filename + l - 4, ".dat" ) ) { // for journal files - fs_fakeChkSum = random(); + + if(!(fs_fakeChkSum = random())) + fs_fakeChkSum = 0xdeadbeef; } Q_strncpyz( fsh[*file].name, filename, sizeof( fsh[*file].name ) ); @@ -3346,6 +3348,7 @@ void FS_Restart( int checksumFeed ) { // set the checksum feed fs_checksumFeed = checksumFeed; + fs_fakeChkSum = 0; // clear pak references FS_ClearPakReferences(0);