projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c6afb28
)
Tried fixing assert error on Windows
author
Christoph Sommer
<mail@christoph-sommer.de>
Mon, 26 Jun 2006 14:21:57 +0000
(14:21 +0000)
committer
Christoph Sommer
<mail@christoph-sommer.de>
Mon, 26 Jun 2006 14:21:57 +0000
(14:21 +0000)
SVN-Revision: 3764
src/random_generator.cpp
patch
|
blob
|
history
diff --git
a/src/random_generator.cpp
b/src/random_generator.cpp
index
ecb95ba
..
c8eac09
100644
(file)
--- a/
src/random_generator.cpp
+++ b/
src/random_generator.cpp
@@
-53,7
+53,7
@@
RandomGenerator::~RandomGenerator() {
int RandomGenerator::srand(int x) {
while (x == 0) // random seed of zero means
- x =
time(0);
// randomize with time
+ x =
(time(0) % RAND_MAX);
// randomize with time
assert(x < RAND_MAX); // only allow posative 31-bit seeds
assert(sizeof(int) >= 4);
srandom(x);