[Scummvm-cvs-logs] SF.net SVN: scummvm:[42664] scummvm/trunk/engines/scumm

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Jul 22 21:25:53 CEST 2009


Revision: 42664
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42664&view=rev
Author:   sev
Date:     2009-07-22 19:25:53 +0000 (Wed, 22 Jul 2009)

Log Message:
-----------
Fix bug #1745396: "MI: Saved game from the credits sequence fails to load".

Now we specifically disallow saves in room 0 for all v4+ games. Original
has exactly this check in all versions, and such games are impossible to load.

Still the problem is not resolved for v0-v3 and HE games.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/dialogs.cpp
    scummvm/trunk/engines/scumm/dialogs.h
    scummvm/trunk/engines/scumm/saveload.cpp

Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp	2009-07-22 16:26:53 UTC (rev 42663)
+++ scummvm/trunk/engines/scumm/dialogs.cpp	2009-07-22 19:25:53 UTC (rev 42664)
@@ -439,7 +439,7 @@
 	new GUI::ButtonWidget(this, "ScummMain.Resume", "Resume", kPlayCmd, 'P');
 
 	new GUI::ButtonWidget(this, "ScummMain.Load", "Load", kLoadCmd, 'L');
-	new GUI::ButtonWidget(this, "ScummMain.Save", "Save", kSaveCmd, 'S');
+	_saveButton = new GUI::ButtonWidget(this, "ScummMain.Save", "Save", kSaveCmd, 'S');
 
 	new GUI::ButtonWidget(this, "ScummMain.Options", "Options", kOptionsCmd, 'O');
 #ifndef DISABLE_HELP
@@ -471,6 +471,15 @@
 	delete _loadDialog;
 }
 
+void ScummMenuDialog::reflowLayout() {
+	// For v4+ games do not allow to save in room 0 just as original did.
+	// It is not possible to load such saves
+	if ((_vm->_game.version >= 4) && (_vm->_currentRoom == 0))
+		_saveButton->setEnabled(false);
+
+	Dialog::reflowLayout();
+}
+
 void ScummMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 	switch (cmd) {
 	case kSaveCmd:

Modified: scummvm/trunk/engines/scumm/dialogs.h
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.h	2009-07-22 16:26:53 UTC (rev 42663)
+++ scummvm/trunk/engines/scumm/dialogs.h	2009-07-22 19:25:53 UTC (rev 42664)
@@ -88,6 +88,8 @@
 	~ScummMenuDialog();
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 
+	virtual void reflowLayout();
+
 protected:
 	ScummEngine		*_vm;
 
@@ -99,6 +101,8 @@
 	SaveLoadChooser	*_saveDialog;
 	SaveLoadChooser	*_loadDialog;
 
+	GUI::ButtonWidget *_saveButton;
+
 	void save();
 	void load();
 };

Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2009-07-22 16:26:53 UTC (rev 42663)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2009-07-22 19:25:53 UTC (rev 42664)
@@ -95,6 +95,10 @@
 }
 
 bool ScummEngine::canSaveGameStateCurrently() {
+	// For v4+ games do not allow to save in room 0
+	if (_game.version >= 4)
+		return (_currentRoom != 0);
+
 	// FIXME: For now always allow loading in V0-V3 games
 	// TODO: Should we disallow saving in some more places,
 	// e.g. when a SAN movie is playing? Not sure whether the


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