aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2009-07-22 19:25:53 +0000
committerEugene Sandulenko2009-07-22 19:25:53 +0000
commit9b031982cf3931c18d0804f23a3fe6779a6204d1 (patch)
treef36788ba19894d3609d7911c394c24b5bfe5db13
parent0932497cca79bba4f10c8443b2a0d45837310946 (diff)
downloadscummvm-rg350-9b031982cf3931c18d0804f23a3fe6779a6204d1.tar.gz
scummvm-rg350-9b031982cf3931c18d0804f23a3fe6779a6204d1.tar.bz2
scummvm-rg350-9b031982cf3931c18d0804f23a3fe6779a6204d1.zip
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. svn-id: r42664
-rw-r--r--engines/scumm/dialogs.cpp11
-rw-r--r--engines/scumm/dialogs.h4
-rw-r--r--engines/scumm/saveload.cpp4
3 files changed, 18 insertions, 1 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 880fab04a5..bef267f6f2 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -439,7 +439,7 @@ ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm)
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 @@ ScummMenuDialog::~ScummMenuDialog() {
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:
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index af844272fa..d4ecbde534 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -88,6 +88,8 @@ public:
~ScummMenuDialog();
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
+ virtual void reflowLayout();
+
protected:
ScummEngine *_vm;
@@ -99,6 +101,8 @@ protected:
SaveLoadChooser *_saveDialog;
SaveLoadChooser *_loadDialog;
+ GUI::ButtonWidget *_saveButton;
+
void save();
void load();
};
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index d474a43b05..4d131b41be 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -95,6 +95,10 @@ Common::Error ScummEngine::saveGameState(int slot, const char *desc) {
}
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