Bugfix No Voice Over Data

This commit is contained in:
Philip W 2024-04-29 17:02:55 +01:00
parent 2acea77079
commit 921cf41e1c

View File

@ -76,7 +76,7 @@ void UAC_PlayerDialogueInterpreter::NextDialogue()
if (IsValid(CurrentChoiceNode)) return; if (IsValid(CurrentChoiceNode)) return;
if (IsValid(CurrentTextNode)) if (IsValid(CurrentTextNode))
{ {
CurrentVoiceOverAudioComponent->Stop(); if (IsValid(CurrentVoiceOverAudioComponent)) CurrentVoiceOverAudioComponent->Stop();
if (CurrentTextNode->ChildrenNodes.Num() == 0) if (CurrentTextNode->ChildrenNodes.Num() == 0)
{ {
EndDialogue(); EndDialogue();
@ -142,7 +142,7 @@ void UAC_PlayerDialogueInterpreter::NextDialogue()
void UAC_PlayerDialogueInterpreter::MakeChoiceDialogue(const int Choice) void UAC_PlayerDialogueInterpreter::MakeChoiceDialogue(const int Choice)
{ {
if (!IsValid(CurrentChoiceNode)) return; if (!IsValid(CurrentChoiceNode)) return;
CurrentVoiceOverAudioComponent->Stop(); if (IsValid(CurrentVoiceOverAudioComponent)) CurrentVoiceOverAudioComponent->Stop();
if (Cast<UDialogueChoiceNode>(CurrentChoiceNode->ChildrenNodes[Choice])) if (Cast<UDialogueChoiceNode>(CurrentChoiceNode->ChildrenNodes[Choice]))
{ {
CurrentChoiceNode = Cast<UDialogueChoiceNode>(CurrentChoiceNode->ChildrenNodes[Choice]); CurrentChoiceNode = Cast<UDialogueChoiceNode>(CurrentChoiceNode->ChildrenNodes[Choice]);
@ -172,7 +172,7 @@ void UAC_PlayerDialogueInterpreter::EndDialogue()
CurrentTextNode = nullptr; CurrentTextNode = nullptr;
CurrentAddItemNode = nullptr; CurrentAddItemNode = nullptr;
CurrentCharacterSpeaking = FDialogueCharacter(); CurrentCharacterSpeaking = FDialogueCharacter();
CurrentVoiceOverAudioComponent->Stop(); if (IsValid(CurrentVoiceOverAudioComponent)) CurrentVoiceOverAudioComponent->Stop();
CurrentVoiceOverAudioComponent = nullptr; CurrentVoiceOverAudioComponent = nullptr;
if (APlayerController* PlayerController = GetWorld()->GetFirstPlayerController()) if (APlayerController* PlayerController = GetWorld()->GetFirstPlayerController())