From cce0aace8b7f2d5c1c1ba18307d6b5ebabbeced5 Mon Sep 17 00:00:00 2001 From: Simei Yin Date: Thu, 13 Jul 2017 23:27:09 +0200 Subject: SLUDGE: get random number --- engines/sludge/builtin.cpp | 5 ++--- engines/sludge/sludge.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/sludge') 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; -- cgit v1.2.3