From 797653132eb3a966a5db585eed51027c5e5e99d2 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Sun, 26 Nov 2023 23:59:53 +0000 Subject: [PATCH] Fixed Multiple Main Waypoints Becoming Focused When Looking at Just One --- .../Content/BountySystem/Waypoint/BP_Waypoint.uasset | 4 ++-- EndlessVendetta/Content/Levels/TrainingFacility.umap | 4 ++-- .../StarterContent/Particles/P_Ambient_Dust.uasset | 4 ++-- .../StarterContent/Props/MaterialSphere.uasset | 4 ++-- .../EndlessVendetta/BountySystem/CheckpointClass.cpp | 1 + .../EndlessVendetta/BountySystem/WaypointActor.cpp | 11 +++++++++-- .../EndlessVendetta/BountySystem/WaypointActor.h | 2 ++ 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset b/EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset index dc557ee3..784cbe0b 100644 --- a/EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset +++ b/EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d5808bd83b46d892a7321c2bad2bee7aec16fbd8b427d0b05b760fcc596c906 -size 105318 +oid sha256:a406c3c753428efd22e472351a913e042fd0653a7430e4ee29ae7149559d92b4 +size 62287 diff --git a/EndlessVendetta/Content/Levels/TrainingFacility.umap b/EndlessVendetta/Content/Levels/TrainingFacility.umap index f16e3960..af04d0dd 100644 --- a/EndlessVendetta/Content/Levels/TrainingFacility.umap +++ b/EndlessVendetta/Content/Levels/TrainingFacility.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3943e1a064276d17b897a7a10a3c42a35c75d6c02117bd1ea962544f3576a9b -size 654898 +oid sha256:68499c0acedf4bd43fa13b5244a3900ad9850ff62e15ac85b1e337859200d06d +size 654847 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index 556e3c1b..bf2e4391 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ca0d15344c39404b70241423c636cec9d5b0f5ef0e4251dc797d3432b3a8263 -size 53268 +oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d +size 43456 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index 56bddfc9..89145d94 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 -size 47333 +oid sha256:b7943b84a70f66da9ce4c738e5748bd6853c3af285ea2f99a76efa584cb31301 +size 47710 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp index 5562a2b8..df618059 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp @@ -46,6 +46,7 @@ void ACheckpointClass::Tick(float DeltaTime) void ACheckpointClass::Destroyed() { if (WaypointActor) WaypointActor->Destroy(); + Super::Destroyed(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.cpp index 6c5f9674..531fff83 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.cpp @@ -22,7 +22,7 @@ void AWaypointActor::SetupWaypoint_Implementation(UTexture2D* Icon, const FStrin ScalingY_Intercept = ScaleAtMaxDist - (MaxDist * ScalingMagnitude); MiniWaypoint = CreateWidget(GetWorld(), MiniWaypointClass); - MiniWaypoint->AddToViewport(1); + MiniWaypoint->AddToViewport(0); MiniWaypoint->WorldLoc = this->GetActorLocation(); MiniWaypoint->PlayerController = GetWorld()->GetFirstPlayerController(); MiniWaypoint->SetIcon(Icon); @@ -51,7 +51,7 @@ bool AWaypointActor::SightCheck() ObjectQueryParams.AddObjectTypesToQuery(ECollisionChannel::ECC_GameTraceChannel2); FVector LT_Start = PlayersCam->GetComponentLocation(); FVector LT_End = LT_Start + (PlayersCam->GetForwardVector() * WaypointFocusDistance); - if (GetWorld()->LineTraceSingleByObjectType(OutHit, LT_Start, LT_End, ObjectQueryParams)) return true; + if (GetWorld()->LineTraceSingleByObjectType(OutHit, LT_Start, LT_End, ObjectQueryParams) && OutHit.GetActor()->GetUniqueID() == this->GetUniqueID()) return true; return false; } @@ -72,3 +72,10 @@ void AWaypointActor::UpdateScaleAndRotation() SetActorScale3D(FVector(1.f, S, S)); } +void AWaypointActor::Destroyed() +{ + if (IsValid(MiniWaypoint)) MiniWaypoint->RemoveFromParent(); + Super::Destroyed(); +} + + diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.h index a8957749..63538881 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/WaypointActor.h @@ -47,6 +47,8 @@ protected: UFUNCTION(BlueprintImplementableEvent) void UpdateVisibility(bool IsVisible); + void Destroyed() override; + public: // Sets default values for this actor's properties AWaypointActor();