[Scummvm-cvs-logs] SF.net SVN: scummvm:[34186] scummvm/trunk/engines/agi

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Aug 26 14:34:05 CEST 2008


Revision: 34186
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34186&view=rev
Author:   thebluegr
Date:     2008-08-26 12:34:05 +0000 (Tue, 26 Aug 2008)

Log Message:
-----------
Correct fix for bug #2073159 - "MICKEY: Incomplete computer message"

Modified Paths:
--------------
    scummvm/trunk/engines/agi/preagi_mickey.cpp
    scummvm/trunk/engines/agi/preagi_mickey.h

Modified: scummvm/trunk/engines/agi/preagi_mickey.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.cpp	2008-08-26 12:15:11 UTC (rev 34185)
+++ scummvm/trunk/engines/agi/preagi_mickey.cpp	2008-08-26 12:34:05 UTC (rev 34186)
@@ -932,10 +932,17 @@
 			if (_vm->getSelection(kSelAnyKey) == 0)
 				return false;
 		} else {
-			if (infile->readUint32BE() != MKID_BE('MICK'))
-				error("Mickey::loadGame wrong save game format");
+			if (infile->readUint32BE() != MKID_BE('MICK')) {
+				warning("Mickey::loadGame wrong save game format");
+				return false;
+			}
 
 			saveVersion = infile->readByte();
+			if (saveVersion < 2) {
+				warning("The planet data in this save game is corrupted. Load aborted");
+				return false;
+			}
+
 			if (saveVersion != MSA_SAVEGAME_VERSION)
 				warning("Old save game version (%d, current version is %d). Will try and read anyway, but don't be surprised if bad things happen", saveVersion, MSA_SAVEGAME_VERSION);
 
@@ -953,7 +960,7 @@
 				_game.iPlanetXtal[i] = infile->readByte();
 
 			for(i = 0; i < IDI_MSA_MAX_PLANET; i++)
-				_game.iClue[i] = infile->readByte();
+				_game.iClue[i] = infile->readUint16LE();
 
 			infile->read(_game.szAddr, IDI_MSA_MAX_BUTTON + 1);
 
@@ -1058,7 +1065,7 @@
 				outfile->writeByte(_game.iPlanetXtal[i]);
 
 			for(i = 0; i < IDI_MSA_MAX_PLANET; i++)
-				outfile->writeByte(_game.iClue[i]);
+				outfile->writeUint16LE(_game.iClue[i]);
 
 			outfile->write(_game.szAddr, IDI_MSA_MAX_BUTTON + 1);
 

Modified: scummvm/trunk/engines/agi/preagi_mickey.h
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.h	2008-08-26 12:15:11 UTC (rev 34185)
+++ scummvm/trunk/engines/agi/preagi_mickey.h	2008-08-26 12:34:05 UTC (rev 34186)
@@ -30,7 +30,7 @@
 
 namespace Agi {
 
-#define MSA_SAVEGAME_VERSION			1
+#define MSA_SAVEGAME_VERSION			2
 
 // strings
 #define IDS_MSA_PATH_DAT	"dat/%s"
@@ -637,7 +637,7 @@
 	{0x5B78,	0x5BB6,	0x5C29,	0x5C76,	0x5CE1},	// pluto
 	{0x526B,	0x52DA,	0x5340,	0x53A1,	0x540C},	// jupiter
 	{0x50F6,	0x512C,	0x5170,	0x51D5,	0x5228},	// mars
-	{0x56AA,	0x571C,	0x579E,	0x5807,	0x5875}	// uranus
+	{0x56AA,	0x571C,	0x579E,	0x5807,	0x5875}		// uranus
 };
 
 // message offsets
@@ -697,7 +697,7 @@
 
 	uint8 nXtals;
 	uint8 iPlanetXtal[IDI_MSA_MAX_DAT];
-	uint8 iClue[IDI_MSA_MAX_PLANET];
+	uint16 iClue[IDI_MSA_MAX_PLANET];
 	char szAddr[IDI_MSA_MAX_BUTTON + 1];
 
 	// Flags


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list