aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gob/gob.h2
-rw-r--r--gob/init.cpp1
-rw-r--r--gob/util.cpp2
3 files changed, 2 insertions, 3 deletions
diff --git a/gob/gob.h b/gob/gob.h
index a0a9878dd5..fe4ecbe697 100644
--- a/gob/gob.h
+++ b/gob/gob.h
@@ -51,7 +51,7 @@ public:
void shutdown();
-
+ Common::RandomSource _rnd;
};
extern GobEngine *_vm;
diff --git a/gob/init.cpp b/gob/init.cpp
index 7c72dc03f2..2a972ef52c 100644
--- a/gob/init.cpp
+++ b/gob/init.cpp
@@ -68,7 +68,6 @@ void init_soundVideo(int32 smallHeap, int16 flag) {
videoMode);
pFileHandler = 0;
- srand(0);
//if ((flag & 4) == 0)
// vid_findVideo();
diff --git a/gob/util.cpp b/gob/util.cpp
index ad5198a693..9596d38215 100644
--- a/gob/util.cpp
+++ b/gob/util.cpp
@@ -126,7 +126,7 @@ int16 util_checkKey(void) {
}
int16 util_getRandom(int16 max) {
- return ((int32)rand() * max) / (RAND_MAX + 1);
+ return _vm->_rnd.getRandomNumber(max - 1);
}
void util_processInput() {