From 7b67425bc20a064d6e72b09ca32f8ace945683d4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 15 Feb 2004 03:53:03 +0000 Subject: More fixes to ScummEngine_v6::o6_pickVarRandom svn-id: r12899 --- scumm/script_v6.cpp | 6 +++--- 1 file 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 { -- cgit v1.2.3