Skip to content

Commit 7844d81

Browse files
committed
Engine: fix character speech text reacting to non-blocking voice-over
Not only PlayVoiceClip could be unrelated to the text, but it could have been run for a different character!
1 parent 1e911b1 commit 7844d81

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Engine/ac/characterinfo_engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ bool UpdateCharacterAnimating(CharacterInfo *chi, CharacterExtras *chex, int &do
340340
bool done_anim = false;
341341
if ((chi->index_id == char_speaking_anim) &&
342342
(play.speech_in_post_state ||
343-
((!play.speech_has_voice) &&
343+
((!play.speech_voice_blocking) &&
344344
(play.close_mouth_speech_time > 0) &&
345345
(play.messagetime < play.close_mouth_speech_time)))) {
346346
// finished talking - stop animation

Engine/ac/display.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ class DisplayMessageState : public GameState
105105

106106
_timer--;
107107

108-
// Special behavior when coupled with a voice-over
109-
if (play.speech_has_voice) {
108+
// Special behavior when coupled with a blocking voice-over
109+
if (play.speech_voice_blocking) {
110110
// extend life of text if the voice hasn't finished yet
111111
if (AudioChans::ChannelIsPlaying(SCHAN_SPEECH) && (play.fast_forward == 0)) {
112112
if (_timer <= 1)

Engine/main/update.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void update_overlay_timers()
324324
void update_speech_and_messages()
325325
{
326326
bool is_voice_playing = false;
327-
if (play.speech_has_voice)
327+
if (play.speech_voice_blocking)
328328
{
329329
auto *ch = AudioChans::GetChannel(SCHAN_SPEECH);
330330
is_voice_playing = ch && ch->is_ready();
@@ -333,7 +333,7 @@ void update_speech_and_messages()
333333
if (play.messagetime>=0) {
334334
play.messagetime--;
335335
// extend life of text if the voice hasn't finished yet
336-
if (play.speech_has_voice && !play.speech_in_post_state) {
336+
if (play.speech_voice_blocking && !play.speech_in_post_state) {
337337
if ((is_voice_playing) && (play.fast_forward == 0)) {
338338
if (play.messagetime <= 1)
339339
play.messagetime = 1;
@@ -371,7 +371,7 @@ void update_speech_and_messages()
371371

372372
bool has_voice_lipsync()
373373
{
374-
return play.speech_has_voice && (curLipLine >= 0);
374+
return play.speech_voice_blocking && (curLipLine >= 0);
375375
}
376376

377377
int update_voice_lipsync(int frame)
@@ -453,13 +453,13 @@ void update_sierra_speech()
453453
// if play.close_mouth_speech_time = 0, this means animation should play till
454454
// the speech ends; but this should not work in voice mode, and also if the
455455
// speech is in the "post" state
456-
(play.speech_has_voice || play.speech_in_post_state || play.close_mouth_speech_time > 0))
456+
(play.speech_voice_blocking || play.speech_in_post_state || play.close_mouth_speech_time > 0))
457457
{ }
458458
else {
459459
// Close mouth at end of sentence: if speech has entered the "post" state,
460460
// or if this is a text only mode and close_mouth_speech_time is set
461461
if (play.speech_in_post_state ||
462-
(!play.speech_has_voice &&
462+
(!play.speech_voice_blocking &&
463463
(play.messagetime < play.close_mouth_speech_time) &&
464464
(play.close_mouth_speech_time > 0))) {
465465
facetalkframe = 0;
@@ -476,7 +476,7 @@ void update_sierra_speech()
476476
// normal non-lip-sync
477477
facetalkframe++;
478478
if ((facetalkframe >= views[facetalkview].loops[facetalkloop].numFrames) ||
479-
(!play.speech_has_voice && (play.messagetime < 1) && (play.close_mouth_speech_time > 0))) {
479+
(!play.speech_voice_blocking && (play.messagetime < 1) && (play.close_mouth_speech_time > 0))) {
480480

481481
if ((facetalkframe >= views[facetalkview].loops[facetalkloop].numFrames) &&
482482
(views[facetalkview].loops[facetalkloop].RunNextLoop()))

0 commit comments

Comments
 (0)