From cf717603916aae5c420055dde35f74660803c95e Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 16 Sep 2004 14:31:16 +0000 Subject: No longer required. svn-id: r15141 --- scumm/script_v6.cpp | 4 ++-- scumm/script_v72he.cpp | 4 ++-- scumm/script_v80he.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'scumm') diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 142e398883..af5c4457a4 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -3002,7 +3002,7 @@ void ScummEngine_v6::o6_pickVarRandom() { int value = fetchScriptWord(); if (readVar(value) == 0) { - defineArray(value, kIntArray, 0, num + 1); + defineArray(value, kIntArray, 0, num); if (num > 0) { int16 counter = 0; do { @@ -3010,7 +3010,7 @@ void ScummEngine_v6::o6_pickVarRandom() { } while (++counter < num); } - shuffleArray(value, 1, num-1); + shuffleArray(value, 1, num); writeArray(value, 0, 0, 2); push(readArray(value, 0, 1)); return; diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 00d20c2ff3..fc396fc58e 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -1699,7 +1699,7 @@ void ScummEngine_v72he::o72_pickVarRandom() { int value = fetchScriptWord(); if (readVar(value) == 0) { - defineArray(value, kDwordArray, 0, 0, 0, num + 1); + defineArray(value, kDwordArray, 0, 0, 0, num); if (num > 0) { int16 counter = 0; do { @@ -1707,7 +1707,7 @@ void ScummEngine_v72he::o72_pickVarRandom() { } while (++counter < num); } - shuffleArray(value, 1, num-1); + shuffleArray(value, 1, num); writeArray(value, 0, 0, 2); push(readArray(value, 0, 1)); return; diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index 72c88b55d9..3a2abee5e6 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -614,7 +614,7 @@ void ScummEngine_v80he::o80_pickVarRandom() { int value = fetchScriptWord(); if (readVar(value) == 0) { - defineArray(value, kDwordArray, 0, 0, 0, num + 1); + defineArray(value, kDwordArray, 0, 0, 0, num); if (value & 0x8000) localizeArray(readVar(value), 0xFFFFFFFF); else if (value & 0x4000) @@ -627,7 +627,7 @@ void ScummEngine_v80he::o80_pickVarRandom() { } while (++counter < num); } - shuffleArray(value, 1, num-1); + shuffleArray(value, 1, num); writeArray(value, 0, 0, 2); push(readArray(value, 0, 1)); return; @@ -638,7 +638,7 @@ void ScummEngine_v80he::o80_pickVarRandom() { ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(value)); dim1end = FROM_LE_32(ah->dim1end); - if (dim1end <= num) { + 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) { -- cgit v1.2.3