BLADERUNNER: Fix mouse in KIA after moonbus massacre ending
This commit is contained in:
parent
e4b8c0f4e3
commit
3322bc44db
2 changed files with 17 additions and 8 deletions
|
@ -323,6 +323,10 @@ Common::Error BladeRunnerEngine::run() {
|
||||||
// additional code for gracefully handling end-game after _endCredits->show()
|
// additional code for gracefully handling end-game after _endCredits->show()
|
||||||
_gameOver = false;
|
_gameOver = false;
|
||||||
_gameIsRunning = true;
|
_gameIsRunning = true;
|
||||||
|
if (!playerHasControl()) {
|
||||||
|
// force a player gains control
|
||||||
|
playerGainsControl(true);
|
||||||
|
}
|
||||||
if (_mouse->isDisabled()) {
|
if (_mouse->isDisabled()) {
|
||||||
// force a mouse enable here since otherwise, after end-game,
|
// force a mouse enable here since otherwise, after end-game,
|
||||||
// we need extra call(s) to mouse->enable to get the _disabledCounter to 0
|
// we need extra call(s) to mouse->enable to get the _disabledCounter to 0
|
||||||
|
@ -1861,16 +1865,21 @@ void BladeRunnerEngine::playerLosesControl() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BladeRunnerEngine::playerGainsControl() {
|
void BladeRunnerEngine::playerGainsControl(bool force) {
|
||||||
if (_playerLosesControlCounter == 0) {
|
if (!force && _playerLosesControlCounter == 0) {
|
||||||
warning("Unbalanced call to BladeRunnerEngine::playerGainsControl");
|
warning("Unbalanced call to BladeRunnerEngine::playerGainsControl");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_playerLosesControlCounter > 0)
|
if (force) {
|
||||||
--_playerLosesControlCounter;
|
_playerLosesControlCounter = 0;
|
||||||
|
_mouse->enable(force);
|
||||||
if (_playerLosesControlCounter == 0) {
|
} else {
|
||||||
_mouse->enable();
|
if (_playerLosesControlCounter > 0) {
|
||||||
|
--_playerLosesControlCounter;
|
||||||
|
}
|
||||||
|
if (_playerLosesControlCounter == 0) {
|
||||||
|
_mouse->enable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ public:
|
||||||
|
|
||||||
bool playerHasControl();
|
bool playerHasControl();
|
||||||
void playerLosesControl();
|
void playerLosesControl();
|
||||||
void playerGainsControl();
|
void playerGainsControl(bool force = false);
|
||||||
void playerDied();
|
void playerDied();
|
||||||
|
|
||||||
bool saveGame(Common::WriteStream &stream, Graphics::Surface &thumbnail);
|
bool saveGame(Common::WriteStream &stream, Graphics::Surface &thumbnail);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue