From ee42aabc2a8d53d83cfc070bd79a8450e5dd99fa Mon Sep 17 00:00:00 2001 From: baz Date: Wed, 13 Dec 2023 21:44:42 +0000 Subject: [PATCH] Temporarily move level reloading on death from Destroyed to OnDeath --- Source/Nakatomi/PlayerCharacter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index ea10a75..1ce9d3d 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -99,10 +99,6 @@ void APlayerCharacter::BeginPlay() void APlayerCharacter::Destroyed() { - FString map = GetWorld()->GetMapName(); - map.RemoveFromStart("UEDPIE_0_"); // We have to remove this for reason, I don't fully understand at the moment - UGameplayStatics::OpenLevel(this, FName(map), false); - Super::Destroyed(); } @@ -445,6 +441,11 @@ void APlayerCharacter::OnDeath() IsFiring = false; ClearAllTimers(); + + // TODO: Move this out into it's own method. + FString map = GetWorld()->GetMapName(); + map.RemoveFromStart("UEDPIE_0_"); // We have to remove this for reason, I don't fully understand at the moment + UGameplayStatics::OpenLevel(this, FName(map), false); } void APlayerCharacter::SetMovementSpeed()