diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_Apartment.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_Apartment.uasset index 665d3b79..0315d174 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_Apartment.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_Apartment.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d96dde71ce13d7ed2661e3fe8d0531e67453e81644492f026f7577c12af0acf9 -size 35286 +oid sha256:ffc0494e896f842e6d6baa4953b6f317c3e2479d2b672611671fdc12fb184555 +size 35802 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest1.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest1.uasset index 34390f30..acb04777 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest1.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a6edb31abcafeab6442cb285181905031da2635eb7c6444b529d9c8636ee9496 -size 29747 +oid sha256:253f8ebabbd32167aa4ecd182352cb52f1c337502351a1bd8f38414f6b3a9d61 +size 29197 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest2.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest2.uasset index af456198..405a3150 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest2.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OpenWorldCheckpoints/OWCP_InteractTest2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7367fb8f5ccaf3e4ae6e34133debe0d5efbaedf33024d14cf37b1f4f5ff7fb1c -size 39283 +oid sha256:1c22f439331d8787e77de31ada2719cc99dd341a7a0564eeb9bd3f8fcafcc2f2 +size 38592 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset index 1984e416..3cd2eccc 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d525f0bed0d08486856e1144f795a8cdd6f0b1e85e9a01ef0bbb4b031f664af -size 252383 +oid sha256:412a1fbdf641138e1bc451eecb3fc9e8a829692d8532a478834269eeadb547b7 +size 246895 diff --git a/EndlessVendetta/Content/Levels/OpenWorldRework.umap b/EndlessVendetta/Content/Levels/OpenWorldRework.umap index 45a4f039..467d1cef 100644 --- a/EndlessVendetta/Content/Levels/OpenWorldRework.umap +++ b/EndlessVendetta/Content/Levels/OpenWorldRework.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40f7960bc31e879f5aa5ad36b4e6fda2398f429962a4058c7a882d5638248246 -size 293166993 +oid sha256:646ca0c6bff400352623eed10c3099c64369e9b3b03540814dbeec8734614f0a +size 293168433 diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index c5c3b84e..3e2a82b7 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 -size 158206 +oid sha256:f30109bb621004d765dc9b21be0826a0a251de164a9e2e5d51be11896dfb4cd0 +size 43745 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index 59734052..bf2e4391 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:25f5aabb2a4a2766e46fddef667521bdc38fd7a47dfa4761fac04a61b78f0bbc -size 53268 +oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d +size 43456 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset index 092ae16d..77f61712 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:25d61d11c54b882a0ca23aa6d56dad1a7d94e58966b7dc179727450a10f3217d +oid sha256:104af43d4801c8514455ec0cd4a2abf35fe76cb41c0c4268176e518963534429 size 8031 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/OpenWorldCheckpoint.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/OpenWorldCheckpoint.h index ded698fc..f644a306 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/OpenWorldCheckpoint.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckPoints/OpenWorldCheckpoint.h @@ -17,4 +17,10 @@ class ENDLESSVENDETTA_API AOpenWorldCheckpoint : public ACheckpointClass protected: UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") FTransform RespawnTransform; + +public: + FTransform GetRespawnTransform() + { + return RespawnTransform; + } }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp index e5d68f4d..b6eb3eb0 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp @@ -3,10 +3,17 @@ #include "MainBountyClass.h" +#include "CheckPoints/OpenWorldCheckpoint.h" + void AMainBountyClass::IncrementBountyCheckpoint() { Super::IncrementBountyCheckpoint(); CompletedACheckpoint.Broadcast(); + if (BountyCheckpoints.IsEmpty() || !IsValid(BountyCheckpoints[0])) return; + if (AOpenWorldCheckpoint* OWCP = Cast(BountyCheckpoints[0])) + { + OpenWorldRespawnTransform = OWCP->GetRespawnTransform(); + } // FString TipToDisplay = ""; // if (!Completed) TipToDisplay = BountyCheckpoints[0]->GetCheckpointTip(); // Cast(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI("", false); diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index afd2952e..98d05e61 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -54,9 +54,12 @@ class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass // Used to Spawn Side Bounties Associated with this Main Bounty UPROPERTY(EditDefaultsOnly, Category = "Bounty") TArray> SideBountiesToSpawn; + + // Used by Bounty Char to determine where to respawn the player based on what checkpoint they're at + FTransform OpenWorldRespawnTransform; protected: - + public: // Struct Containing all Data to be Displayed about the Main Bounty UPROPERTY(EditDefaultsOnly, Category = "Bounty") @@ -68,7 +71,7 @@ private: void IncrementBountyCheckpoint() override; protected: - + public: // Used by Bounty Char to Save and Spawn Side Bounties Unlocked by Activating this Main Bounty @@ -94,6 +97,10 @@ public: // Overrides to Desapwn Waypoint from OpenWorld Checkpoint void DeActivateFirstCheckpoint() override; + FTransform GetOpenWorldRespawnTransform() + { + return OpenWorldRespawnTransform; + } // Returns open world checkpoints tip // FString GetOpenWorldCheckpointTip() // { diff --git a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp index 5c9bc331..17bc04d1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp @@ -133,9 +133,12 @@ void ABountyHunterCharacter::BeginPlay() InOpenWorld = true; SpawnBikeUI(); SpawnSideBounties(GI); - FTransform SpawnTransfrom = GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave; - SetActorTransform(SpawnTransfrom); - Cast(GetController())->SetControlRotation(SpawnTransfrom.GetRotation().Rotator()); + if (GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave.GetLocation() != FVector(0 ,0 ,0)) + { + FTransform SpawnTransfrom = GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave; + SetActorTransform(SpawnTransfrom); + Cast(GetController())->SetControlRotation(SpawnTransfrom.GetRotation().Rotator()); + } } } CreatePauseMenuTabs(); @@ -157,9 +160,15 @@ void ABountyHunterCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); if (UGameplayStatics::GetCurrentLevelName(GetWorld()) != OpenWorldLevelName) return; + UEVGameInstance* GI = Cast(GetGameInstance()); if (!IsValid(GI->MainSaveGameInstanceRef)) return; - GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = GetActorTransform(); + + // if main bounty exists, save its locally stored open world respawn transform + // otherwise, store it as 0,0,0 which will make the player spawn at player start instead + FTransform EmptyTransform; + GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = IsValid(CurrentMainBounty) ? CurrentMainBounty->GetOpenWorldRespawnTransform() : EmptyTransform; + //GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = GetActorTransform(); UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0); }