aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/cl_main.c
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-05-31 19:48:28 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-05-31 19:48:28 +0000
commite3fc31a512c6636777ab81a31eff789f2d4c64ff (patch)
treed13f686d79db091c7bbf5c5cc8a706a3d92ec70c /code/client/cl_main.c
parent25f4f42f9bfa511cc7e170a379855f5c2419a8d2 (diff)
downloadioquake3-aero-e3fc31a512c6636777ab81a31eff789f2d4c64ff.tar.gz
ioquake3-aero-e3fc31a512c6636777ab81a31eff789f2d4c64ff.zip
- Introduce seeding of the random number generator at startup
- Replaced all engine-side occurances of rand() with random() git-svn-id: svn://svn.icculus.org/quake3/trunk@1561 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/cl_main.c')
-rw-r--r--code/client/cl_main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 01c044a..08ee747 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -1306,12 +1306,8 @@ void CL_RequestMotd( void ) {
BigShort( cls.updateServer.port ) );
info[0] = 0;
- // NOTE TTimo xoring against Com_Milliseconds, otherwise we may not have a true randomization
- // only srand I could catch before here is tr_noise.c l:26 srand(1001)
- // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=382
- // NOTE: the Com_Milliseconds xoring only affects the lower 16-bit word,
- // but I decided it was enough randomization
- Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", ((rand() << 16) ^ rand()) ^ Com_Milliseconds());
+
+ Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", (random() << 16) ^ random());
Info_SetValueForKey( info, "challenge", cls.updateChallenge );
Info_SetValueForKey( info, "renderer", cls.glconfig.renderer_string );