aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorThanasis Antoniou2019-04-04 21:01:25 +0300
committerThanasis Antoniou2019-04-04 21:03:10 +0300
commitf04705084c6745b67766f33eac25cc73b4d3f524 (patch)
treef54608dbc31fff10871fa0ded267104a61f16893 /engines/bladerunner/script
parente4b78f4f621a7d73c08099c3b7674f3966cf8da4 (diff)
downloadscummvm-rg350-f04705084c6745b67766f33eac25cc73b4d3f524.tar.gz
scummvm-rg350-f04705084c6745b67766f33eac25cc73b4d3f524.tar.bz2
scummvm-rg350-f04705084c6745b67766f33eac25cc73b4d3f524.zip
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.
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/scene/hf05.cpp7
-rw-r--r--engines/bladerunner/script/script.cpp5
-rw-r--r--engines/bladerunner/script/script.h1
3 files changed, 13 insertions, 0 deletions
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);