Bugfix VisionLink to Deactivate WIP Fucntionalilty

This commit is contained in:
Rafal Swierczek 2023-10-02 13:56:50 +01:00 committed by PHILIP WHITE
parent f92605ebee
commit 282705ed2f

View File

@ -10,7 +10,7 @@ void AVisionLink::BeginPlay()
CooldownLength = CooldownTime; CooldownLength = CooldownTime;
InUseDuration = GadgetMaxUptime; InUseDuration = GadgetMaxUptime;
if (NumberOfPingPulses <= 0 ) NumberOfPingPulses = 1; if (NumberOfPingPulses <= 0) NumberOfPingPulses = 1;
TimeInbetweenPingPulses = GadgetMaxUptime / (float)NumberOfPingPulses; TimeInbetweenPingPulses = GadgetMaxUptime / (float)NumberOfPingPulses;
} }
@ -28,7 +28,7 @@ void AVisionLink::Activate()
void AVisionLink::FinishedUsing() void AVisionLink::FinishedUsing()
{ {
VisionLinkRecharging(); VisionLinkRecharging();
Super::FinishedUsing(); Super::FinishedUsing();
} }
@ -38,18 +38,15 @@ void AVisionLink::SendOutPingPulse()
UpdatePulsesRemaining(NumOfPingPulsesLeftInThisCycle); UpdatePulsesRemaining(NumOfPingPulsesLeftInThisCycle);
if (NumOfPingPulsesLeftInThisCycle < 0) return; if (NumOfPingPulsesLeftInThisCycle < 0) return;
FActorSpawnParameters SpawnParams; //FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; //SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
FVector SpawnLoc = (GetActorLocation() - EquippedOffset) + EnemyLOSTestActor.GetDefaultObject()->SpawnOffset; //FVector SpawnLoc = (GetActorLocation() - EquippedOffset) + EnemyLOSTestActor.GetDefaultObject()->SpawnOffset;
AActor* LOSTestActor = GetWorld()->SpawnActor<AActor>(EnemyLOSTestActor, SpawnLoc, GetActorRotation(), SpawnParams); // AActor* LOSTestActor = GetWorld()->SpawnActor<AActor>(EnemyLOSTestActor, SpawnLoc, GetActorRotation(), SpawnParams);
TArray<FString> EmptyFStringArray; // TArray<FString> EmptyFStringArray;
Cast<AVisionLinkEnemyLOSTest>(LOSTestActor)->TestLOS(EmptyFStringArray, GetOwner()); // Cast<AVisionLinkEnemyLOSTest>(LOSTestActor)->TestLOS(EmptyFStringArray, GetOwner());
UE_LOG(LogTemp, Warning, TEXT("Ping Pulse!")); UE_LOG(LogTemp, Warning, TEXT("Ping Pulse!"));
GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false); GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false);
PlayPingPulseAnim(TimeInbetweenPingPulses); PlayPingPulseAnim(TimeInbetweenPingPulses);
} }