aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v80he.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scumm/script_v80he.cpp')
-rw-r--r--scumm/script_v80he.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index 3a2abee5e6..345ab72c51 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -641,8 +641,9 @@ void ScummEngine_v80he::o80_pickVarRandom() {
if (dim1end < num) {
int16 var_2 = readArray(value, 0, num - 1);
shuffleArray(value, 1, dim1end);
- if (readArray(value, 0, 1) == var_2 && var_2 >= 3) {
- int tmp = readArray(value, 0, 2);
+ num = 1;
+ if (readArray(value, 0, 1) == var_2 && dim1end >= 3) {
+ int16 tmp = readArray(value, 0, 2);
writeArray(value, 0, num, tmp);
writeArray(value, 0, 2, var_2);
}