aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-02-16 12:11:50 +0200
committerFilippos Karapetis2015-02-16 12:11:50 +0200
commitf04ef8b7282477cda5121b6c8a6e838eb35a1760 (patch)
tree61db93be16f29182bfbc259f996e33abc23a9c5d /engines
parent60e83c2d9ca68e4dd90c0d644ac500b5f3be491e (diff)
downloadscummvm-rg350-f04ef8b7282477cda5121b6c8a6e838eb35a1760.tar.gz
scummvm-rg350-f04ef8b7282477cda5121b6c8a6e838eb35a1760.tar.bz2
scummvm-rg350-f04ef8b7282477cda5121b6c8a6e838eb35a1760.zip
ZVISION: Fix script bug #6793 in Zork Nemesis
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/file/save_manager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/zvision/file/save_manager.cpp b/engines/zvision/file/save_manager.cpp
index 1e0c57e2b3..63b54269de 100644
--- a/engines/zvision/file/save_manager.cpp
+++ b/engines/zvision/file/save_manager.cpp
@@ -165,6 +165,27 @@ Common::Error SaveManager::loadGame(int slot) {
if (header.thumbnail)
delete header.thumbnail;
+ if (_engine->getGameId() == GID_NEMESIS && scriptManager->getCurrentLocation() == "tv2f") {
+ // WORKAROUND for script bug #6793: location tv2f (stairs) has two states:
+ // one at the top of the stairs, and one at the bottom. When the player
+ // goes to the bottom of the stairs, the screen changes, and hotspot
+ // 4652 (exit opposite the stairs) is enabled. However, the variable that
+ // controls the state (2408) is reset when the player goes down the stairs.
+ // Furthermore, the room's initialization script disables the stair exit
+ // control (4652). This leads to an impossible situation, where all the
+ // exit controls are disabled, and the player can't more anywhere. Thus,
+ // when loading a game in that room, we check for that impossible
+ // situation, which only occurs after the player has moved down the stairs,
+ // and fix it here by setting the correct background, and enabling the
+ // stair exit hotspot.
+ if ((scriptManager->getStateFlag(2411) & Puzzle::DISABLED) &&
+ (scriptManager->getStateFlag(2408) & Puzzle::DISABLED) &&
+ (scriptManager->getStateFlag(4652) & Puzzle::DISABLED)) {
+ _engine->getRenderManager()->setBackgroundImage("tv2fb21c.tga");
+ scriptManager->unsetStateFlag(4652, Puzzle::DISABLED);
+ }
+ }
+
return Common::kNoError;
}