Merge branch 'BugFixes' into dev
This commit is contained in:
commit
8e5fd68b83
BIN
EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.png
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.png
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/Waypoint/TextBackground.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Levels/TrainingFacility.umap
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Levels/TrainingFacility.umap
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset
(Stored with Git LFS)
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
#include "CollisionDebugDrawingPublic.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
#include "EndlessVendetta/EndlessVendettaCharacter.h"
|
||||
#include "GameFramework/Character.h"
|
||||
|
||||
void AVisionLink::BeginPlay()
|
||||
@ -47,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);
|
||||
}
|
||||
|
||||
@ -75,7 +82,7 @@ void AVisionLink::TestLOS(FTransform StartingPos, TArray<AActor*> &ActorsToIgnor
|
||||
if (!GetWorld()->LineTraceSingleByChannel(outHit, StartingPos.GetLocation(), LT_EndPoint, ECC_Camera, QueryParams)) continue;
|
||||
|
||||
AActor* HitActor = outHit.GetActor();
|
||||
if (!HitActor->ActorHasTag(FName("Enemy"))) continue;
|
||||
if (!HitActor->ActorHasTag(FName("Enemy")) || HitActor->ActorHasTag("Dead")) continue;
|
||||
|
||||
//DrawDebugLine(GetWorld(), outHit.TraceStart, outHit.ImpactPoint, FColor::Blue, false, 3, 0, 3);
|
||||
ActorsToIgnore.Add(HitActor);
|
||||
|
@ -3,7 +3,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
#include "EndlessVendetta/GadgetSystem/ReconGadget.h"
|
||||
#include "VisionLink.generated.h"
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
|
||||
#include "Components/BoxComponent.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
|
||||
// Sets default values
|
||||
AVisionLinkEnemyLOSTest::AVisionLinkEnemyLOSTest()
|
||||
{
|
||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void AVisionLinkEnemyLOSTest::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void AVisionLinkEnemyLOSTest::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}
|
||||
|
||||
void AVisionLinkEnemyLOSTest::TestLOS(TArray<uint32> EnemiesInLink, AActor* LOSActor)
|
||||
{
|
||||
// Get all overlapping Actors
|
||||
UBoxComponent* CollisionBox = Cast<UBoxComponent>(GetComponentByClass(UBoxComponent::StaticClass()));
|
||||
if (!IsValid(CollisionBox))
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
TArray<AActor*> OverlappingEnemies;
|
||||
CollisionBox->GetOverlappingActors(OverlappingEnemies);
|
||||
if (OverlappingEnemies.IsEmpty())
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < OverlappingEnemies.Num(); i++)
|
||||
{
|
||||
// Overlapping Enemies Array should only contain enemies which aren't already in the link
|
||||
if (!OverlappingEnemies[i]->ActorHasTag(FName("Enemy")) || EnemiesInLink.Contains(OverlappingEnemies[i]->GetUniqueID()))
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("enemy name: %s"), *OverlappingEnemies[i]->GetName());
|
||||
OverlappingEnemies.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
if (OverlappingEnemies.IsEmpty())
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
/*for (AActor* Enemy : OverlappingEnemies)
|
||||
{
|
||||
FRotator LookAtRotation = UKismetMathLibrary::FindLookAtRotation(LOSActor->GetActorLocation(), Enemy->GetActorLocation());
|
||||
UE_LOG(LogTemp, Warning, TEXT("Look at Rotation: %f"), LookAtRotation.Yaw);
|
||||
}*/
|
||||
|
||||
Destroy();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "VisionLinkEnemyLOSTest.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class ENDLESSVENDETTA_API AVisionLinkEnemyLOSTest : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
float SpawnOffset = 0;
|
||||
|
||||
// Sets default values for this actor's properties
|
||||
AVisionLinkEnemyLOSTest();
|
||||
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
void TestLOS(TArray<uint32> EnemiesInLink, AActor* LOS_Actor);
|
||||
};
|
Loading…
Reference in New Issue
Block a user