aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-01-25 18:16:02 +0000
committerTorbjörn Andersson2005-01-25 18:16:02 +0000
commit8bfbc143a817730b8d9aa37c71e0638af9009b62 (patch)
treea28fe1ba37c24074ed3b002956da5aa6e5176b15 /saga
parentcfe996642cbc0088c4d157a712b773a26f975a58 (diff)
downloadscummvm-rg350-8bfbc143a817730b8d9aa37c71e0638af9009b62.tar.gz
scummvm-rg350-8bfbc143a817730b8d9aa37c71e0638af9009b62.tar.bz2
scummvm-rg350-8bfbc143a817730b8d9aa37c71e0638af9009b62.zip
The sfRand() script function was slightly wrong
Old behaviour: 0 <= random number <= param Correct behaviour: 0 <= random number < param svn-id: r16636
Diffstat (limited to 'saga')
-rw-r--r--saga/sfuncs.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index 10513f3215..2f3447694f 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -1525,8 +1525,7 @@ void Script::SF_protectResult(SCRIPTFUNC_PARAMS) {
void Script::sfRand(SCRIPTFUNC_PARAMS) {
int16 param = thread->pop();
- thread->_returnValue = (_vm->_rnd.getRandomNumber(param));
-
+ thread->_returnValue = _vm->_rnd.getRandomNumber(param - 1);
}
// Script function #76 (0x4c)