diff options
Diffstat (limited to 'engines/drascula/saveload.cpp')
-rw-r--r-- | engines/drascula/saveload.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index d0f16aa941..eb65486687 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -44,8 +44,8 @@ void DrasculaEngine::checkForOldSaveGames() { return; GUI::MessageDialog dialog0( - _("ScummVM found that you have old savefiles for Drascula that should be converted.\n" - "The old save game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n" + _("ScummVM found that you have old saved games for Drascula that should be converted.\n" + "The old saved game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n" "Press OK to convert them now, otherwise you will be asked again the next time you start the game.\n"), _("OK"), _("Cancel")); int choice = dialog0.runModal(); @@ -256,6 +256,19 @@ bool DrasculaEngine::loadGame(int slot) { error("missing savegame file %s", saveFileName.c_str()); } + // If we currently are in room 102 while being attached below the pendulum + // the character is invisible and some surface are temporarily used for other + // things. Reset those before loading the savegame otherwise we may have some + // issues such as the protagonist being invisible after reloading a savegame. + if (_roomNumber == 102 && flags[1] == 2) { + characterVisible = 1; + loadPic(96, frontSurface); + loadPic(97, frontSurface); + loadPic(97, extraSurface); + loadPic(99, backSurface); + } + + loadMetaData(in, slot, true); Graphics::skipThumbnail(*in); @@ -287,9 +300,24 @@ bool DrasculaEngine::loadGame(int slot) { if (!sscanf(currentData, "%d.ald", &roomNum)) { error("Bad save format"); } + + // When loading room 102 while being attached below the pendulum Some variables + // are not correctly set and can cause random crashes when calling enterRoom below. + // The crash occurs in moveCharacters() when accessing factor_red[curY + curHeight]. + if (roomNum == 102 && flags[1] == 2) { + curX = 103; + curY = 108; + curWidth = curHeight = 0; + } + enterRoom(roomNum); selectVerb(kVerbNone); + // When loading room 102 while being attached below the pendulum we + // need to call activatePendulum() to properly initialized the scene. + if (_roomNumber == 102 && flags[1] == 2) + activatePendulum(); + return true; } |