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()
|
||||
_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,18 +1865,23 @@ 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)
|
||||
if (force) {
|
||||
_playerLosesControlCounter = 0;
|
||||
_mouse->enable(force);
|
||||
} else {
|
||||
if (_playerLosesControlCounter > 0) {
|
||||
--_playerLosesControlCounter;
|
||||
|
||||
}
|
||||
if (_playerLosesControlCounter == 0) {
|
||||
_mouse->enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRunnerEngine::playerDied() {
|
||||
playerLosesControl();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue