Not sure what these changes were for, but they are stored here for review.

This commit is contained in:
Jamie Greunbaum 2024-06-28 14:42:17 -04:00
parent 80afa2a4b4
commit 91b2ad6162
13 changed files with 14 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -49,8 +49,6 @@ ABugPlacerPawn::ABugPlacerPawn()
void ABugPlacerPawn::BeginPlay()
{
this->OriginalPlayer = UGameplayStatics::GetPlayerCharacter(this, 0);
this->Activate();
Super::BeginPlay();
@ -129,6 +127,9 @@ void ABugPlacerPawn::TraceTimerElapsed()
this->TraceOriginComponent->SetRelativeScale3D(FVector(TraceOriginScale.X, TraceOriginScale.Y, (TraceEnd - TraceStart).Length()));
}
}
float TraceInterval = this->GetActorTickInterval() > 0.0f ? this->GetActorTickInterval() : (1.0f / 60.0f) * World->GetWorldSettings()->MinGlobalTimeDilation;
this->GetWorldTimerManager().SetTimer(this->TraceTimerHandle, this, &ABugPlacerPawn::TraceTimerElapsed, TraceInterval, false);
}
@ -159,14 +160,17 @@ void ABugPlacerPawn::Activate()
{
this->SavedMaxSpeed = this->PawnMovement->GetMaxSpeed();
UGameplayStatics::GetPlayerController(this, 0)->Possess(this);
APlayerController *Controller = UGameplayStatics::GetPlayerController(this, 0);
this->OriginalPawn = Controller->GetPawn();
this->OriginalPawn->DisableInput(Controller);
Controller->Possess(this);
const float &MinTimeDilation = this->GetWorldSettings()->MinGlobalTimeDilation;
this->GetWorldSettings()->SetTimeDilation(MinTimeDilation);
this->CustomTimeDilation = 1.0 / MinTimeDilation;
//this->GetWorldSettings()->SetTimeDilation(MinTimeDilation);
//this->CustomTimeDilation = 1.0 / MinTimeDilation;
float TraceInterval = this->GetActorTickInterval() > 0.0f ? this->GetActorTickInterval() : (1.0f / 60.0f) * MinTimeDilation;
this->GetWorldTimerManager().SetTimer(this->TraceTimerHandle, this, &ABugPlacerPawn::TraceTimerElapsed, TraceInterval, true);
this->GetWorldTimerManager().SetTimer(this->TraceTimerHandle, this, &ABugPlacerPawn::TraceTimerElapsed, TraceInterval, false);
}
void ABugPlacerPawn::Deactivate()
@ -174,7 +178,9 @@ void ABugPlacerPawn::Deactivate()
this->GetWorldTimerManager().ClearAllTimersForObject(this);
this->GetWorldSettings()->SetTimeDilation(1.0f);
UGameplayStatics::GetPlayerController(this, 0)->Possess(this->OriginalPlayer);
APlayerController *Controller = UGameplayStatics::GetPlayerController(this, 0);
Controller->Possess(this->OriginalPawn);
this->OriginalPawn->EnableInput(Controller);
this->Destroy();
}

View File

@ -84,7 +84,7 @@ private:
uint8 bArbitraryPlacement : 1;
uint8 bCurrentTraceHit : 1;
TObjectPtr<class ACharacter> OriginalPlayer;
TObjectPtr<class APawn> OriginalPawn;
TObjectPtr<class ABugMarkerActor> BugMarker;