aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-03-02 07:11:58 +0000
committerTorbjörn Andersson2005-03-02 07:11:58 +0000
commit27bcd6e47a0978d88b6d680d303fde666c0d96e7 (patch)
tree06decb65dd3025b9dfd23ba463b908889e7dca26
parentf097bcbf2bfc3ab5918c73716d15caddb16db140 (diff)
downloadscummvm-rg350-27bcd6e47a0978d88b6d680d303fde666c0d96e7.tar.gz
scummvm-rg350-27bcd6e47a0978d88b6d680d303fde666c0d96e7.tar.bz2
scummvm-rg350-27bcd6e47a0978d88b6d680d303fde666c0d96e7.zip
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
-rw-r--r--scumm/saveload.cpp10
1 files changed, 10 insertions, 0 deletions
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);