Update Final Checkpoint to Return to Main Menu on Competition

This commit is contained in:
Philip W 2024-05-14 12:20:30 +01:00
parent 1babde28e4
commit 5332a00a4e

View File

@ -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<ABountyHunterCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->GetOpenWorldLevelName());
UGameplayStatics::OpenLevel(GetWorld(), OpnWrldLvlName);
}