diff options
author | Willem Jan Palenstijn | 2011-12-18 12:38:53 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-18 12:38:53 +0100 |
commit | 4178ad6b681d32de567b00833b18bf992cbffd92 (patch) | |
tree | 847d1fb0c0b7c2eb6161ff799fc9c6b8a713439d /engines/dreamweb | |
parent | 5d1e1fbbbcff5c930b1f929883e9e0cf897e585f (diff) | |
download | scummvm-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.cpp | 12 |
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) { |