diff --git a/Source/DTFluxUtilities/Private/DTFluxUtils.cpp b/Source/DTFluxUtilities/Private/DTFluxUtils.cpp index f83a02c..a711937 100644 --- a/Source/DTFluxUtilities/Private/DTFluxUtils.cpp +++ b/Source/DTFluxUtilities/Private/DTFluxUtils.cpp @@ -56,11 +56,12 @@ void UFTDFluxUtils::GetFullName(const int Bib, FText& OutFullName) UE_LOG(logDTFluxUtilities, Error, TEXT("DTFluxCoreSubsystem not available")); } -TArray& UFTDFluxUtils::SortSplitRankingsByRank(TArray& OutRankings) +TArray UFTDFluxUtils::SortSplitRankingsByRank(const TArray& Rankings) { - OutRankings.Sort([](const FDTFluxSplitSensorInfo& A, const FDTFluxSplitSensorInfo& B) + TArray CopyRankings = Rankings; + CopyRankings.Sort([](const FDTFluxSplitSensorInfo& A, const FDTFluxSplitSensorInfo& B) { return A.Rank < B.Rank; }); - return OutRankings; + return CopyRankings; } \ No newline at end of file diff --git a/Source/DTFluxUtilities/Public/DTFluxUtils.h b/Source/DTFluxUtilities/Public/DTFluxUtils.h index 94d0ed6..8f1aa92 100644 --- a/Source/DTFluxUtilities/Public/DTFluxUtils.h +++ b/Source/DTFluxUtilities/Public/DTFluxUtils.h @@ -5,7 +5,7 @@ #include "CoreMinimal.h" #include "DTFluxCore/Public/Types/Struct/DTFluxTeamListStruct.h" #include "Kismet/BlueprintFunctionLibrary.h" -#include "Types/Struct/DTFluxRankingStructs.h" +#include "Types/Struct/DTFluxSplitSensor.h" #include "DTFluxUtils.generated.h" /** @@ -71,7 +71,7 @@ public: static void GetFullName(const int Bib, FText& OutFullName); UFUNCTION(BlueprintCallable, Category="DTFlux|Utils") - static TArray& SortSplitRankingsByRank(TArray& OutRankings); + static TArray SortSplitRankingsByRank(const TArray& OutRankings); };