aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorHein-Pieter van Braam2017-05-26 11:44:37 -0500
committerColin Snover2017-05-26 12:21:43 -0500
commit04fb40be2d1cc004f4f745434a93ff67694bba27 (patch)
tree87e66a528482892bd027c94d012cc49338883b31 /engines
parent78f69e198c8198075ded9e557bf1e2807a1c49f0 (diff)
downloadscummvm-rg350-04fb40be2d1cc004f4f745434a93ff67694bba27.tar.gz
scummvm-rg350-04fb40be2d1cc004f4f745434a93ff67694bba27.tar.bz2
scummvm-rg350-04fb40be2d1cc004f4f745434a93ff67694bba27.zip
SCI32: Fix kArrayFill
The ScummVM implementation of class SciArray::fill() has a bug where it will overwrite the array[index] with the value count times, rather than fill the array starting from index count times. This patch fixes that behavior. This was noticed because the LSL7 dice game was broken, it was impossible to lose. After this patch the dice game works as expected. Closes gh-953.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/segment.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 344977c391..adc8f138be 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -740,7 +740,7 @@ public:
case kArrayTypeID: {
reg_t *target = (reg_t *)_data + index;
while (count--) {
- *target = value;
+ *target++ = value;
}
break;
}
@@ -749,7 +749,7 @@ public:
byte *target = (byte *)_data + index;
const byte fillValue = value.getOffset();
while (count--) {
- *target = fillValue;
+ *target++ = fillValue;
}
break;
}