aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-02-15 03:53:03 +0000
committerEugene Sandulenko2004-02-15 03:53:03 +0000
commit7b67425bc20a064d6e72b09ca32f8ace945683d4 (patch)
treeee336cfc94dbb59d1b5cb5e894efd677510241c7
parent955a96ada55f6ba1a5974664eae18591e3f40748 (diff)
downloadscummvm-rg350-7b67425bc20a064d6e72b09ca32f8ace945683d4.tar.gz
scummvm-rg350-7b67425bc20a064d6e72b09ca32f8ace945683d4.tar.bz2
scummvm-rg350-7b67425bc20a064d6e72b09ca32f8ace945683d4.zip
More fixes to ScummEngine_v6::o6_pickVarRandom
svn-id: r12899
-rw-r--r--scumm/script_v6.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 564ab13bc2..cd2f979dd8 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -3033,7 +3033,7 @@ void ScummEngine_v6::o6_pickVarRandom() {
} while (++counter < num);
}
- shuffleArray(value, 1, num);
+ shuffleArray(value, 1, num-1);
writeArray(value, 0, 0, 2);
push(readArray(value, 0, 1));
return;
@@ -3050,9 +3050,9 @@ void ScummEngine_v6::o6_pickVarRandom() {
var_C = READ_LE_UINT16(ptr + 4);
}
- if (var_A <= num) {
+ if (var_A-1 <= num) {
int16 var_2 = readArray(value, 0, num - 1);
- shuffleArray(value, 1, var_A - 1);
+ shuffleArray(value, 1, num - 1);
if (readArray(value, 0, 1) == var_2) {
num = 2;
} else {