From 27bcd6e47a0978d88b6d680d303fde666c0d96e7 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 2 Mar 2005 07:11:58 +0000 Subject: When restoring older savegames, fill the script slot 'cycle' fields with what I hope is a sensible value. This fixes a regression with a MonkeyVGA savegame I had where none of the scripts that should have been running were since all 'cycle' fields were 0. svn-id: r16969 --- scumm/saveload.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 5d32a184c5..6c0d698114 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -730,6 +730,16 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { else s->saveLoadArrayOf(vm.slot, NUM_SCRIPT_SLOT, sizeof(vm.slot[0]), scriptSlotEntries); + if (savegameVersion < VER(46)) { + // When loading an old savegame, make sure that the 'cycle' + // field is set to something sensible, otherwise the scripts + // that were running probably won't be. + + for (i = 0; i < NUM_SCRIPT_SLOT; i++) { + vm.slot[i].cycle = 1; + } + } + if (_heversion >= 71) { Wiz *wiz = &((ScummEngine_v70he *)this)->_wiz; s->saveLoadArrayOf(wiz->_polygons, ARRAYSIZE(wiz->_polygons), sizeof(wiz->_polygons[0]), polygonEntries); -- cgit v1.2.3