From 8bfbc143a817730b8d9aa37c71e0638af9009b62 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 25 Jan 2005 18:16:02 +0000 Subject: The sfRand() script function was slightly wrong Old behaviour: 0 <= random number <= param Correct behaviour: 0 <= random number < param svn-id: r16636 --- saga/sfuncs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'saga') 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) -- cgit v1.2.3