From f04705084c6745b67766f33eac25cc73b4d3f524 Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Thu, 4 Apr 2019 21:01:25 +0300 Subject: BLADERUNNER: Support wait for dialogue queues to finish Fixes a Crazylegs bug where he can interrupt himself Could probably be used elsewhere if there are any other such cases. --- engines/bladerunner/bladerunner.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/bladerunner/bladerunner.cpp') diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 911a46ad83..2752baa393 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -1693,6 +1693,22 @@ void BladeRunnerEngine::loopActorSpeaking() { playerGainsControl(); } +/** +* To be used only for when there is a chance an ongoing dialogue in a dialogue queue +* might be interrupted AND that is unwanted behavior (sometimes, it's intended that the dialogue +* can be interrupted without necessarily being finished). +*/ +void BladeRunnerEngine::loopQueuedDialogueStillPlaying() { + if (_actorDialogueQueue->isEmpty()) { + return; + } + + do { + gameTick(); + } while (_gameIsRunning && !_actorDialogueQueue->isEmpty()); + +} + void BladeRunnerEngine::outtakePlay(int id, bool noLocalization, int container) { Common::String name = _gameInfo->getOuttake(id); -- cgit v1.2.3