DREAMWEB: Fix ReelRoutine terminator saving/loading

This commit is contained in:
Willem Jan Palenstijn 2011-12-18 12:38:53 +01:00
parent 5d1e1fbbbc
commit 4178ad6b68

View file

@ -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) {