Fixing GetFullName
This commit is contained in:
@ -31,28 +31,27 @@ void UFTDFluxUtils::GetFullName(const int Bib, FText& OutFullName)
|
|||||||
{
|
{
|
||||||
OutFullName = FText();
|
OutFullName = FText();
|
||||||
UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
||||||
FDTFluxParticipant Participant;
|
if(CoreSubsystem != nullptr)
|
||||||
CoreSubsystem->GetParticipant(Bib, Participant);
|
|
||||||
{
|
{
|
||||||
FDTFluxParticipant OutParticipant;
|
FDTFluxParticipant Participant;
|
||||||
if(CoreSubsystem->GetParticipant(Bib, OutParticipant))
|
if(CoreSubsystem->GetParticipant(Bib, Participant))
|
||||||
{
|
|
||||||
FString FormattedName = "";
|
|
||||||
if (OutParticipant.IsTeam())
|
|
||||||
{
|
{
|
||||||
OutFullName = FText::FromString(Participant.Team);
|
FString FormattedName = "";
|
||||||
|
if (Participant.IsTeam())
|
||||||
|
{
|
||||||
|
OutFullName = FText::FromString(Participant.Team);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Participant.GetTeammate().IsEmpty())
|
||||||
|
{
|
||||||
|
UE_LOG(logDTFluxUtilities, Warning, TEXT("Non teammate found with Bib %i"), Bib)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OutFullName = FText::FromString(FString::Printf(TEXT("%s %s"), *Participant.GetTeammate()[0].FirstName,
|
||||||
|
*Participant.GetTeammate()[0].LastName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Participant.GetTeammate().IsEmpty())
|
UE_LOG(logDTFluxUtilities, Warning, TEXT("Participant not found with Bib %i"), Bib);
|
||||||
{
|
|
||||||
UE_LOG(logDTFluxUtilities, Warning, TEXT("Non teammate found with Bib %i"), Bib)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OutFullName = FText::FromString(FString::Printf(TEXT("%s %s"), *Participant.GetTeammate()[0].FirstName,
|
|
||||||
*Participant.GetTeammate()[0].LastName));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UE_LOG(logDTFluxUtilities, Warning, TEXT("Participant not found with Bib %i"), Bib);
|
|
||||||
}
|
}
|
||||||
UE_LOG(logDTFluxUtilities, Error, TEXT("DTFluxCoreSubsystem not available"));
|
UE_LOG(logDTFluxUtilities, Error, TEXT("DTFluxCoreSubsystem not available"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user