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/script/scene/hf05.cpp | 7 +++++++ engines/bladerunner/script/script.cpp | 5 +++++ engines/bladerunner/script/script.h | 1 + 3 files changed, 13 insertions(+) (limited to 'engines/bladerunner/script') diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp index 4cdc3f02b7..54ffe91b79 100644 --- a/engines/bladerunner/script/scene/hf05.cpp +++ b/engines/bladerunner/script/scene/hf05.cpp @@ -690,6 +690,13 @@ void SceneScriptHF05::talkWithCrazyLegs1() { Ambient_Sounds_Play_Sound(149, 99, 99, 0, 0); Actor_Face_Actor(kActorCrazylegs, kActorMcCoy, true); Actor_Face_Actor(kActorMcCoy, kActorCrazylegs, true); +#if BLADERUNNER_ORIGINAL_BUGS +#else + // There is a chance here that Crazylegs will "interrupt himself" + // and thus sometimes skip the last sentence of the above queued dialogue in chapter 3. + // So we explicitly wait for the queue to be emptied before proceeding to his next line + ADQ_Wait_For_All_Queued_Dialogue(); +#endif // BLADERUNNER_ORIGINAL_BUGS Actor_Says(kActorCrazylegs, 170, kAnimationModeTalk); Actor_Says(kActorCrazylegs, 180, 12); Actor_Says(kActorCrazylegs, 190, 14); diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 15b6067030..9242b294c4 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -1551,6 +1551,11 @@ void ScriptBase::ADQ_Add_Pause(int delay) { _vm->_actorDialogueQueue->addPause(delay); } +void ScriptBase::ADQ_Wait_For_All_Queued_Dialogue() { + debugC(kDebugScript, "ADQ_Wait_For_All_Queued_Dialogue()"); + _vm->loopQueuedDialogueStillPlaying(); +} + bool ScriptBase::Game_Over() { debugC(kDebugScript, "Game_Over()"); _vm->_gameIsRunning = false; diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index f52fc52431..340752ac4c 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -259,6 +259,7 @@ protected: void ADQ_Flush(); void ADQ_Add(int actorId, int sentenceId, int animationMode); void ADQ_Add_Pause(int delay); + void ADQ_Wait_For_All_Queued_Dialogue(); bool Game_Over(); void Autosave_Game(int textId); void I_Sez(const char *str); -- cgit v1.2.3