aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-18 12:38:53 +0100
committerWillem Jan Palenstijn2011-12-18 12:38:53 +0100
commit4178ad6b681d32de567b00833b18bf992cbffd92 (patch)
tree847d1fb0c0b7c2eb6161ff799fc9c6b8a713439d /engines/dreamweb
parent5d1e1fbbbcff5c930b1f929883e9e0cf897e585f (diff)
downloadscummvm-rg350-4178ad6b681d32de567b00833b18bf992cbffd92.tar.gz
scummvm-rg350-4178ad6b681d32de567b00833b18bf992cbffd92.tar.bz2
scummvm-rg350-4178ad6b681d32de567b00833b18bf992cbffd92.zip
DREAMWEB: Fix ReelRoutine terminator saving/loading
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/saveload.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 52f28515f5..4001cb1448 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -432,9 +432,11 @@ void DreamGenContext::savePosition(unsigned int slot, const char *descbuf) {
// TODO: Convert more to serializer?
Common::Serializer s(0, outSaveFile);
- for (unsigned int i = 0; 8 * i < kLenofreelrouts; ++i) {
- syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8 * i, 8));
+ for (unsigned int i = 0; 8*i < kLenofreelrouts - 1; ++i) {
+ syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8*i, 8));
}
+ // Terminator
+ s.syncAsByte(*data.ptr(kReelroutines + kLenofreelrouts - 1, 1));
// ScummVM data block
outSaveFile->writeUint32BE(SCUMMVM_HEADER);
@@ -498,9 +500,11 @@ void DreamGenContext::loadPosition(unsigned int slot) {
// TODO: Use serializer for more
Common::Serializer s(inSaveFile, 0);
- for (unsigned int i = 0; 8 * i < kLenofreelrouts; ++i) {
- syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8 * i, 8));
+ for (unsigned int i = 0; 8*i < kLenofreelrouts - 1; ++i) {
+ syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8*i, 8));
}
+ // Terminator
+ s.syncAsByte(*data.ptr(kReelroutines + kLenofreelrouts - 1, 1));
// Check if there's a ScummVM data block
if (header.len(6) == SCUMMVM_BLOCK_MAGIC_SIZE) {