aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2007-12-28 11:07:35 +0000
committerPaul Gilbert2007-12-28 11:07:35 +0000
commit4d7e49ddb8a082f5da7ab7d2d0b8425c5a3e09cc (patch)
tree66cef38d3d5177a5e0258721b2b866777f434457
parent8464150d4299531b4f08f7aff8123e023a2d71f9 (diff)
downloadscummvm-rg350-4d7e49ddb8a082f5da7ab7d2d0b8425c5a3e09cc.tar.gz
scummvm-rg350-4d7e49ddb8a082f5da7ab7d2d0b8425c5a3e09cc.tar.bz2
scummvm-rg350-4d7e49ddb8a082f5da7ab7d2d0b8425c5a3e09cc.zip
Fix to prevent the F5 key allowing the game to be saved during player conversations or viewing a remote room
svn-id: r30048
-rw-r--r--engines/lure/game.cpp18
-rw-r--r--engines/lure/game.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index 98089f5668..938cd173a8 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -193,7 +193,8 @@ void Game::execute() {
bool handled = true;
switch (events.event().kbd.keycode) {
case Common::KEYCODE_F5:
- SaveRestoreDialog::show(true);
+ if (isMenuAvailable())
+ SaveRestoreDialog::show(true);
break;
case Common::KEYCODE_F7:
@@ -1015,6 +1016,21 @@ bool Game::getYN() {
return result;
}
+bool Game::isMenuAvailable() {
+ Resources &res = Resources::getReference();
+ Room &room = Room::getReference();
+ uint16 oldRoomNumber = res.fieldList().getField(OLD_ROOM_NUMBER);
+
+ if (oldRoomNumber != 0)
+ // Viewing a room remotely - so the menu isn't available
+ return false;
+
+ else if ((room.cursorState() == CS_TALKING) || (res.getTalkState() != TALK_NONE))
+ return false;
+
+ return true;
+}
+
void Game::saveToStream(WriteStream *stream) {
stream->writeByte(_fastTextFlag);
stream->writeByte(_soundFlag);
diff --git a/engines/lure/game.h b/engines/lure/game.h
index d5f57aa8ff..ea066335b8 100644
--- a/engines/lure/game.h
+++ b/engines/lure/game.h
@@ -66,6 +66,7 @@ private:
void displayBarrelAnimation();
void handleBootParam(int value);
bool getYN();
+ bool isMenuAvailable();
public:
Game();
virtual ~Game();