[Scummvm-git-logs] scummvm master -> 04fb40be2d1cc004f4f745434a93ff67694bba27
csnover
csnover at users.noreply.github.com
Fri May 26 19:21:53 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
04fb40be2d SCI32: Fix kArrayFill
Commit: 04fb40be2d1cc004f4f745434a93ff67694bba27
https://github.com/scummvm/scummvm/commit/04fb40be2d1cc004f4f745434a93ff67694bba27
Author: Hein-Pieter van Braam (hp at tmm.cx)
Date: 2017-05-26T12:21:43-05:00
Commit Message:
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.
Changed paths:
engines/sci/engine/segment.h
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 344977c..adc8f13 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;
}
More information about the Scummvm-git-logs
mailing list