aboutsummaryrefslogtreecommitdiffstats
path: root/code/server
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/server
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/server')
-rw-r--r--code/server/sv_client.c2
-rw-r--r--code/server/sv_init.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/code/server/sv_client.c b/code/server/sv_client.c
index e208a5b..6c3e2e0 100644
--- a/code/server/sv_client.c
+++ b/code/server/sv_client.c
@@ -73,7 +73,7 @@ void SV_GetChallenge( netadr_t from ) {
// this is the first time this client has asked for a challenge
challenge = &svs.challenges[oldest];
- challenge->challenge = ( (rand() << 16) ^ rand() ) ^ svs.time;
+ challenge->challenge = ( (random() << 16) ^ random() ) ^ svs.time;
challenge->adr = from;
challenge->firstTime = svs.time;
challenge->time = svs.time;
diff --git a/code/server/sv_init.c b/code/server/sv_init.c
index 874aeaf..47c9810 100644
--- a/code/server/sv_init.c
+++ b/code/server/sv_init.c
@@ -475,8 +475,7 @@ void SV_SpawnServer( char *server, qboolean killBots ) {
Cvar_Set("cl_paused", "0");
// get a new checksum feed and restart the file system
- srand(Com_Milliseconds());
- sv.checksumFeed = ( ((int) rand() << 16) ^ rand() ) ^ Com_Milliseconds();
+ sv.checksumFeed = ( ((int) random() << 16) ^ random() ) ^ Com_Milliseconds();
FS_Restart( sv.checksumFeed );
CM_LoadMap( va("maps/%s.bsp", server), qfalse, &checksum );