From 5332a00a4e70c630007f6beca5cb7fd34c2e808f Mon Sep 17 00:00:00 2001 From: PHILIP WHITE Date: Tue, 14 May 2024 12:20:30 +0100 Subject: [PATCH] Update Final Checkpoint to Return to Main Menu on Competition --- .../BountySystem/CheckPoints/FinalCheckpoint.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/FinalCheckpoint.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/FinalCheckpoint.cpp index 2556bda7..2284bfef 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/FinalCheckpoint.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/FinalCheckpoint.cpp @@ -14,6 +14,12 @@ void AFinalCheckpoint::CompleteBounty() GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave++; UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0); + if (UGameplayStatics::GetCurrentLevelName(GetWorld()) == "Apartment_hit") + { + UGameplayStatics::OpenLevel(GetWorld(), "MainMenuLevel"); + return; + } + FName OpnWrldLvlName = FName(Cast(GetWorld()->GetFirstPlayerController()->GetPawn())->GetOpenWorldLevelName()); UGameplayStatics::OpenLevel(GetWorld(), OpnWrldLvlName); }