aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-09-16 14:31:16 +0000
committerTravis Howell2004-09-16 14:31:16 +0000
commitcf717603916aae5c420055dde35f74660803c95e (patch)
treeb6870799b1d9441b62f61a8aa845a96fef276709 /scumm
parent0a320ac7aff085a791c6b865fcc23c5659a2b881 (diff)
downloadscummvm-rg350-cf717603916aae5c420055dde35f74660803c95e.tar.gz
scummvm-rg350-cf717603916aae5c420055dde35f74660803c95e.tar.bz2
scummvm-rg350-cf717603916aae5c420055dde35f74660803c95e.zip
No longer required.
svn-id: r15141
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v6.cpp4
-rw-r--r--scumm/script_v72he.cpp4
-rw-r--r--scumm/script_v80he.cpp6
3 files changed, 7 insertions, 7 deletions
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) {