Bugfix Dialogue Not Playing Past Beginning Dialogue

This commit is contained in:
Philip W 2024-05-11 20:41:37 +01:00
parent 59b876ee1b
commit fa43f61fee

View File

@ -59,8 +59,10 @@ void UAC_PlayerDialogueInterpreter::StartDialogue(UDialogueTree* DialogueTree)
CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking);
OnStartDialogue.Broadcast(CurrentTextNode);
if (IsValid(CurrentTextNode->DialogueVoiceOver))
{
CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D(
GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false);
}
if (APlayerController* PlayerController = GetWorld()->GetFirstPlayerController())
{
@ -94,6 +96,8 @@ void UAC_PlayerDialogueInterpreter::NextDialogue()
CurrentTextNode = Cast<UDialogueTextNode>(CurrentTextNode->ChildrenNodes[0]);
CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking);
OnNextDialogue.Broadcast(CurrentTextNode);
CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D(
GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false);
CurrentChoiceNode = nullptr;
CurrentAddItemNode = nullptr;
}