diff options
author | Sven Hesse | 2007-08-02 16:21:49 +0000 |
---|---|---|
committer | Sven Hesse | 2007-08-02 16:21:49 +0000 |
commit | 8d09c1a3ade02211565a4c74ddaa72a15138f574 (patch) | |
tree | 133f008c35958eebdcb2269d41210207edaf91e5 /engines/gob | |
parent | b9092cc18d717cf62d1a09364916bbca3b671296 (diff) | |
download | scummvm-rg350-8d09c1a3ade02211565a4c74ddaa72a15138f574.tar.gz scummvm-rg350-8d09c1a3ade02211565a4c74ddaa72a15138f574.tar.bz2 scummvm-rg350-8d09c1a3ade02211565a4c74ddaa72a15138f574.zip |
Don't crash at getRandom(0)
svn-id: r28411
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/util.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index ec8bb59f06..40acf21f9e 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -49,6 +49,9 @@ uint32 Util::getTimeKey(void) { } int16 Util::getRandom(int16 max) { + if (max == 0) + return 0; + return _vm->_rnd.getRandomNumber(max - 1); } |