Removed Redundant LOS Test Box

This commit is contained in:
Rafal Swierczek 2023-10-03 20:30:36 +01:00
parent 7bb582f636
commit 6dee50a62b
4 changed files with 6 additions and 30 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:16b8ace32a02155ad001cb46a64f3b5bef4c4c4ae6f13f0a6e13ac5d683c9a3c
size 14694

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9e3dc3ac3d7558e57253059c870b13d20e67e639f7a748c3c6a384d65ae7df7f
oid sha256:236689015c26708fac1bf19a6077122a373dbd62804e8b0643abe62a82db39ae
size 109712

View File

@ -43,17 +43,6 @@ void AVisionLink::SendOutPingPulse()
UpdatePulsesRemaining(NumOfPingPulsesLeftInThisCycle);
if (NumOfPingPulsesLeftInThisCycle < 0) return;
// FActorSpawnParameters SpawnParams;
// SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
// FVector SpawnLoc = PlayerCamComp->GetComponentLocation() + PlayerCamComp->GetForwardVector() * EnemyLOSTestActor->GetDefaultObject<AVisionLinkEnemyLOSTest>()->SpawnOffset;
//
//
// AActor* LOSTestActor = GetWorld()->SpawnActor<AActor>(EnemyLOSTestActor, SpawnLoc, PlayerCamComp->GetComponentRotation(), SpawnParams);
// TArray<uint32> EmptyIDArray;
// Cast<AVisionLinkEnemyLOSTest>(LOSTestActor)->TestLOS(EmptyIDArray, this);
UE_LOG(LogTemp, Warning, TEXT("Ping Pulse!"));
GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false);
PlayPingPulseAnim(TimeInbetweenPingPulses);
@ -84,19 +73,14 @@ void AVisionLink::TestLOS(FTransform StartingPos, TArray<AActor*> &ActorsToIgnor
if (!GetWorld()->LineTraceSingleByChannel(outHit, StartingPos.GetLocation(), LT_EndPoint, ECC_Camera, QueryParams)) continue;
// Only consider enemies which we haven't seen before
AActor* HitActor = outHit.GetActor();
if (!HitActor->ActorHasTag(FName("Enemy"))) continue; //|| EnemiesInLink.Contains(HitActor->GetUniqueID())) continue;
if (!HitActor->ActorHasTag(FName("Enemy"))) continue;
DrawDebugLine(GetWorld(), outHit.TraceStart, outHit.ImpactPoint, FColor::Blue, false, 3, 0, 3);
ActorsToIgnore.Add(HitActor);
UE_LOG(LogTemp, Warning, TEXT("I've Seen an Enemy called: %s"), *HitActor->GetName());
//Spawn in a Ping
TestLOS(HitActor->GetTransform(), ActorsToIgnore);
}
}
}

View File

@ -21,10 +21,10 @@ class ENDLESSVENDETTA_API AVisionLink : public AReconGadget
FTimerHandle PulseHandle;
void TestLOS(FTransform StartingPos, TArray<AActor*> &ActorsToIgnore);
void SendOutPingPulse();
void TestLOS(FTransform StartingPos, TArray<AActor*> &ActorsToIgnore);
virtual void BeginPlay() override;
virtual void Activate() override;
@ -50,11 +50,6 @@ protected:
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
float V_FOV = 25;
// UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
// TSubclassOf<AVisionLinkEnemyLOSTest> EnemyLOSTestActor;
UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
float CooldownLength;