aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {