From 9d32a0a0e3fe0ce740cf5dbdd297a26f32525e86 Mon Sep 17 00:00:00 2001 From: Louis Hobbs Date: Thu, 29 Jun 2023 18:10:31 +0100 Subject: [PATCH] Add temporary fix for level loading --- Source/Nakatomi/PlayerCharacter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index 410dad7..4d136bf 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -3,6 +3,7 @@ #include "PlayerCharacter.h" // You can remove these, this is just to get intellisense to work +#include #include #include @@ -80,9 +81,11 @@ void APlayerCharacter::BeginPlay() void APlayerCharacter::Destroyed() { - Super::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); - UGameplayStatics::OpenLevel(GetWorld(), FName(GetWorld()->GetMapName())); + Super::Destroyed(); } // Called every frame