diff --git a/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp b/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp index 2da43e6..26813a7 100644 --- a/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp +++ b/Source/StevesUEHelpers/Private/StevesUI/TypewriterTextWidget.cpp @@ -331,6 +331,11 @@ FString UTypewriterTextWidget::CalculateSegments(FString* OutCurrentRunName) { Result += TEXT(""); } + if (OutCurrentRunName) + { + *OutCurrentRunName = Segment.RunInfo.Name; + } + } if (bIsSegmentComplete) @@ -344,19 +349,7 @@ FString UTypewriterTextWidget::CalculateSegments(FString* OutCurrentRunName) break; } } - - if (OutCurrentRunName) - { - if (CurrentSegmentIndex < Segments.Num()) - { - *OutCurrentRunName = Segments[CurrentSegmentIndex].RunInfo.Name; - } - else - { - *OutCurrentRunName = ""; - } - } - + return Result; }