From 8c628451a436bdbe99651588a81d35bbb99754bc Mon Sep 17 00:00:00 2001 From: Timon Roemer <t.roemer@vis.rwth-aachen.de> Date: Tue, 12 Mar 2024 13:53:43 +0100 Subject: [PATCH] Changes copy to reference in actor loop --- Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp index f47d49f7..644f30c9 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp @@ -3,6 +3,7 @@ #include "EnhancedInputSubsystems.h" #include "Components/WidgetComponent.h" #include "Haptics/HapticFeedbackEffect_Curve.h" +#include "Kismet/GameplayStatics.h" #include "Materials/MaterialParameterCollection.h" #include "Materials/MaterialParameterCollectionInstance.h" #include "Misc/MessageDialog.h" @@ -413,7 +414,7 @@ UIntenSelectable* UIntenSelectComponent::GetMaxScoreActor(const float DeltaTime) auto DistanceToMaxScore = FVector::Distance(MaxScoreSelectable->GetOwner()->GetActorLocation(), GetComponentLocation()); auto Dist = TNumericLimits<float>::Max(); - for (const auto Actor : CandidateList) + for (const TPair<UIntenSelectable*, FHitResult>& Actor : CandidateList) { const auto DistanceToCandidate = FVector::Distance(Actor.Value.ImpactPoint, GetComponentLocation()); if (DistanceToCandidate < Dist) -- GitLab