From 331259cc1ba8473165cfec23504cf09e5508c466 Mon Sep 17 00:00:00 2001 From: RAFAL SWIERCZEK Date: Thu, 30 Nov 2023 10:15:38 +0000 Subject: [PATCH] Bugfix Equipped Guns Block LOS for Vision Link --- EndlessVendetta/Content/Levels/TrainingFacility.umap | 4 ++-- .../GadgetClasses/Recon/VisionLink/VisionLink.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/Levels/TrainingFacility.umap b/EndlessVendetta/Content/Levels/TrainingFacility.umap index 19053416..174ac378 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:9085d76489c04f7d273f580154acee8bbe53b285514f36e2770d3be3e9407730 -size 679662 +oid sha256:7711a7f6afcfd75419a73d627b6359ec3fb76c48d9dbb34e50b2a2318ee05b7d +size 679380 diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp index 890916c0..09cbf980 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp @@ -6,6 +6,7 @@ #include "CollisionDebugDrawingPublic.h" #include "Kismet/KismetMathLibrary.h" #include "Camera/CameraComponent.h" +#include "EndlessVendetta/EndlessVendettaCharacter.h" #include "GameFramework/Character.h" void AVisionLink::BeginPlay() @@ -46,9 +47,16 @@ void AVisionLink::SendOutPingPulse() GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false); PlayPingPulseAnim(TimeInbetweenPingPulses); - UCameraComponent* PlayerCamComp = Cast(GetWorld()->GetFirstPlayerController()->GetCharacter()->GetComponentByClass(UCameraComponent::StaticClass())); + ACharacter* PlayersCharacter = GetWorld()->GetFirstPlayerController()->GetCharacter(); + UCameraComponent* PlayerCamComp = Cast(PlayersCharacter->GetComponentByClass(UCameraComponent::StaticClass())); + + // Ignored Actors TArray ActorsToIgnore; - ActorsToIgnore.Add(GetWorld()->GetFirstPlayerController()->GetCharacter()); + AEndlessVendettaCharacter* EV_Character = Cast(PlayersCharacter); + if ( IsValid(EV_Character) && IsValid(EV_Character->PrimaryWeaponActor)) ActorsToIgnore.Add(EV_Character->PrimaryWeaponActor); + if ( IsValid(EV_Character) && IsValid(EV_Character->SecondaryWeaponActor)) ActorsToIgnore.Add(EV_Character->SecondaryWeaponActor); + ActorsToIgnore.Add(PlayersCharacter); + TestLOS(PlayerCamComp->GetComponentTransform(), ActorsToIgnore); }