[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.cpp,1.193,1.194

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Tue Mar 1 23:12:20 CET 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18811

Modified Files:
	saveload.cpp 
Log Message:
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.


Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- saveload.cpp	28 Feb 2005 13:23:10 -0000	1.193
+++ saveload.cpp	2 Mar 2005 07:11:58 -0000	1.194
@@ -730,6 +730,16 @@
 	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);





More information about the Scummvm-git-logs mailing list