From 135d1b6d3dae87bdbe3e3be940e477770ee3aace Mon Sep 17 00:00:00 2001 From: PRO100KatYT <67335438+PRO100KatYT@users.noreply.github.com> Date: Fri, 19 May 2023 16:40:08 +0200 Subject: [PATCH] =?UTF-8?q?Rotated=2090=C2=B0=20chest=20loot=20stuck=20in?= =?UTF-8?q?=20wall=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project Reboot 3.0/Actor.cpp | 9 +++++++++ Project Reboot 3.0/Actor.h | 1 + Project Reboot 3.0/BuildingContainer.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Project Reboot 3.0/Actor.cpp b/Project Reboot 3.0/Actor.cpp index 2d49522..abc30cd 100644 --- a/Project Reboot 3.0/Actor.cpp +++ b/Project Reboot 3.0/Actor.cpp @@ -114,6 +114,15 @@ FVector AActor::GetActorRightVector() return ret; } +FVector AActor::GetActorUpVector() +{ + static auto GetActorUpVectorFn = FindObject("/Script/Engine.Actor.GetActorUpVector"); + FVector ret; + this->ProcessEvent(GetActorUpVectorFn, &ret); + + return ret; +} + FRotator AActor::GetActorRotation() { static auto K2_GetActorRotationFn = FindObject(L"/Script/Engine.Actor.K2_GetActorRotation"); diff --git a/Project Reboot 3.0/Actor.h b/Project Reboot 3.0/Actor.h index 9d824de..a679fdc 100644 --- a/Project Reboot 3.0/Actor.h +++ b/Project Reboot 3.0/Actor.h @@ -28,6 +28,7 @@ public: struct FVector GetActorScale3D(); struct FVector GetActorLocation(); struct FVector GetActorRightVector(); + struct FVector GetActorUpVector(); void K2_DestroyActor(); class UActorComponent* GetComponentByClass(class UClass* ComponentClass); float GetDistanceTo(AActor* OtherActor); diff --git a/Project Reboot 3.0/BuildingContainer.cpp b/Project Reboot 3.0/BuildingContainer.cpp index 53deb19..31d102e 100644 --- a/Project Reboot 3.0/BuildingContainer.cpp +++ b/Project Reboot 3.0/BuildingContainer.cpp @@ -7,7 +7,7 @@ bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn) { auto GameMode = Cast(GetWorld()->GetGameMode()); - FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorRightVector() * 70.f + FVector{ 0, 0, 50 }; + FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorRightVector() * 70.f + this->GetActorUpVector() * 50.f; static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup"); auto RedirectedLootTier = GameMode->RedirectLootTier(this->Get(SearchLootTierGroupOffset));