aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimei Yin2017-07-13 23:27:09 +0200
committerSimei Yin2017-07-13 23:29:26 +0200
commitcce0aace8b7f2d5c1c1ba18307d6b5ebabbeced5 (patch)
tree525a43267b00d96144451b8a0ba98e75848bf7c0
parentb60aa5eae76c049d301ed6a6727ac2f558a4e821 (diff)
downloadscummvm-rg350-cce0aace8b7f2d5c1c1ba18307d6b5ebabbeced5.tar.gz
scummvm-rg350-cce0aace8b7f2d5c1c1ba18307d6b5ebabbeced5.tar.bz2
scummvm-rg350-cce0aace8b7f2d5c1c1ba18307d6b5ebabbeced5.zip
SLUDGE: get random number
-rw-r--r--engines/sludge/builtin.cpp5
-rw-r--r--engines/sludge/sludge.h1
2 files changed, 3 insertions, 3 deletions
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index ee1304997c..56db190c82 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -511,9 +511,8 @@ builtIn(pickOne) {
}
int i;
-#if 0
- i = rand() % numParams;
-#endif
+
+ i = g_sludge->getRandomSource()->getRandomNumber(numParams - 1);
// Return value
while (numParams--) {
diff --git a/engines/sludge/sludge.h b/engines/sludge/sludge.h
index cb3d5248b0..e419b85f0e 100644
--- a/engines/sludge/sludge.h
+++ b/engines/sludge/sludge.h
@@ -71,6 +71,7 @@ public:
Common::Language getLanguage() const;
Graphics::PixelFormat *getScreenPixelFormat() const;
Graphics::PixelFormat *getOrigPixelFormat() const;
+ Common::RandomSource *getRandomSource() const { return _rnd; };
const char *getGameFile() const;