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
This commit is contained in:
Torbjörn Andersson 2005-03-02 07:11:58 +00:00
parent f097bcbf2b
commit 27bcd6e47a

View file

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