Bugfix Equipped Guns Block LOS for Vision Link
This commit is contained in:
parent
354b3b2a11
commit
331259cc1b
BIN
EndlessVendetta/Content/Levels/TrainingFacility.umap
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Levels/TrainingFacility.umap
(Stored with Git LFS)
Binary file not shown.
@ -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<UCameraComponent>(GetWorld()->GetFirstPlayerController()->GetCharacter()->GetComponentByClass(UCameraComponent::StaticClass()));
|
||||
ACharacter* PlayersCharacter = GetWorld()->GetFirstPlayerController()->GetCharacter();
|
||||
UCameraComponent* PlayerCamComp = Cast<UCameraComponent>(PlayersCharacter->GetComponentByClass(UCameraComponent::StaticClass()));
|
||||
|
||||
// Ignored Actors
|
||||
TArray<AActor*> ActorsToIgnore;
|
||||
ActorsToIgnore.Add(GetWorld()->GetFirstPlayerController()->GetCharacter());
|
||||
AEndlessVendettaCharacter* EV_Character = Cast<AEndlessVendettaCharacter>(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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user