From d6db4826c6fa2a01178f7116c75ca42df1a999c8 Mon Sep 17 00:00:00 2001 From: PRO100KatYT <67335438+PRO100KatYT@users.noreply.github.com> Date: Sun, 21 May 2023 18:36:39 +0200 Subject: [PATCH] Get the LocationToSpawnLoot values from LootSpawnLocation_Athena --- Project Reboot 3.0/Actor.cpp | 9 +++++++++ Project Reboot 3.0/Actor.h | 1 + Project Reboot 3.0/BuildingContainer.cpp | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Project Reboot 3.0/Actor.cpp b/Project Reboot 3.0/Actor.cpp index abc30cd..09d53e3 100644 --- a/Project Reboot 3.0/Actor.cpp +++ b/Project Reboot 3.0/Actor.cpp @@ -105,6 +105,15 @@ FVector AActor::GetActorLocation() return ret; } +FVector AActor::GetActorForwardVector() +{ + static auto GetActorForwardVectorFn = FindObject("/Script/Engine.Actor.GetActorForwardVector"); + FVector ret; + this->ProcessEvent(GetActorForwardVectorFn, &ret); + + return ret; +} + FVector AActor::GetActorRightVector() { static auto GetActorRightVectorFn = FindObject("/Script/Engine.Actor.GetActorRightVector"); diff --git a/Project Reboot 3.0/Actor.h b/Project Reboot 3.0/Actor.h index a679fdc..51282ce 100644 --- a/Project Reboot 3.0/Actor.h +++ b/Project Reboot 3.0/Actor.h @@ -27,6 +27,7 @@ public: AActor* GetOwner(); struct FVector GetActorScale3D(); struct FVector GetActorLocation(); + struct FVector GetActorForwardVector(); struct FVector GetActorRightVector(); struct FVector GetActorUpVector(); void K2_DestroyActor(); diff --git a/Project Reboot 3.0/BuildingContainer.cpp b/Project Reboot 3.0/BuildingContainer.cpp index 6d2bfad..b595aa7 100644 --- a/Project Reboot 3.0/BuildingContainer.cpp +++ b/Project Reboot 3.0/BuildingContainer.cpp @@ -7,7 +7,12 @@ bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn) { auto GameMode = Cast(GetWorld()->GetGameMode()); - FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorRightVector() * 70.f + this->GetActorUpVector() * 50.f; + + static auto LootSpawnLocationOffset = this->GetOffset("LootSpawnLocation_Athena"); + + auto LSL = this->Get(LootSpawnLocationOffset); + + FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorForwardVector() * LSL.X + this->GetActorRightVector() * LSL.Y + this->GetActorUpVector() * LSL.Z; static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup"); auto RedirectedLootTier = GameMode->RedirectLootTier(this->Get(SearchLootTierGroupOffset));