aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-10-11 16:34:26 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-10-11 16:34:26 +0000
commit4217dcf119bd52d41c779c66a87de13cfa704448 (patch)
treeccabf22bd90d9e498f86e9cca68c0204f826c76b
parent950552fcdf86618b97a5af141b11a709b4111e31 (diff)
downloadioquake3-aero-4217dcf119bd52d41c779c66a87de13cfa704448.tar.gz
ioquake3-aero-4217dcf119bd52d41c779c66a87de13cfa704448.zip
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
git-svn-id: svn://svn.icculus.org/quake3/trunk@1654 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--code/qcommon/files.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index 7bbfc45..7b4fc81 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);