aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner
diff options
context:
space:
mode:
authorThanasis Antoniou2019-05-23 02:17:56 +0300
committerThanasis Antoniou2019-05-23 02:17:56 +0300
commit3322bc44db112d0f35118d80e835b27f6b76668b (patch)
tree71ae0c93803c451c68d2d5e433c5f473fd4768bc /engines/bladerunner
parente4b8c0f4e3911062bbbb4829d85b11be80a0e8ae (diff)
downloadscummvm-rg350-3322bc44db112d0f35118d80e835b27f6b76668b.tar.gz
scummvm-rg350-3322bc44db112d0f35118d80e835b27f6b76668b.tar.bz2
scummvm-rg350-3322bc44db112d0f35118d80e835b27f6b76668b.zip
BLADERUNNER: Fix mouse in KIA after moonbus massacre ending
Diffstat (limited to 'engines/bladerunner')
-rw-r--r--engines/bladerunner/bladerunner.cpp23
-rw-r--r--engines/bladerunner/bladerunner.h2
2 files changed, 17 insertions, 8 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index cd8cbbe298..c0f2544e75 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -323,6 +323,10 @@ Common::Error BladeRunnerEngine::run() {
// additional code for gracefully handling end-game after _endCredits->show()
_gameOver = false;
_gameIsRunning = true;
+ if (!playerHasControl()) {
+ // force a player gains control
+ playerGainsControl(true);
+ }
if (_mouse->isDisabled()) {
// force a mouse enable here since otherwise, after end-game,
// we need extra call(s) to mouse->enable to get the _disabledCounter to 0
@@ -1861,16 +1865,21 @@ void BladeRunnerEngine::playerLosesControl() {
}
}
-void BladeRunnerEngine::playerGainsControl() {
- if (_playerLosesControlCounter == 0) {
+void BladeRunnerEngine::playerGainsControl(bool force) {
+ if (!force && _playerLosesControlCounter == 0) {
warning("Unbalanced call to BladeRunnerEngine::playerGainsControl");
}
- if (_playerLosesControlCounter > 0)
- --_playerLosesControlCounter;
-
- if (_playerLosesControlCounter == 0) {
- _mouse->enable();
+ if (force) {
+ _playerLosesControlCounter = 0;
+ _mouse->enable(force);
+ } else {
+ if (_playerLosesControlCounter > 0) {
+ --_playerLosesControlCounter;
+ }
+ if (_playerLosesControlCounter == 0) {
+ _mouse->enable();
+ }
}
}
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 33ab032bb8..2c1aec4c1b 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -296,7 +296,7 @@ public:
bool playerHasControl();
void playerLosesControl();
- void playerGainsControl();
+ void playerGainsControl(bool force = false);
void playerDied();
bool saveGame(Common::WriteStream &stream, Graphics::Surface &thumbnail);