From f6be54705df4a5e784e70742e81137357cac3c1a Mon Sep 17 00:00:00 2001 From: Gray <84999745+Milxnor@users.noreply.github.com> Date: Tue, 15 Jul 2025 12:40:41 -0400 Subject: [PATCH] fix 18.40 cone &e diting :) --- Project Reboot 3.0/FortItemDefinition.h | 9 +++++++++ Project Reboot 3.0/GameModeBase.cpp | 4 ++-- Project Reboot 3.0/bots.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Project Reboot 3.0/FortItemDefinition.h b/Project Reboot 3.0/FortItemDefinition.h index 854eec5..e911e1f 100644 --- a/Project Reboot 3.0/FortItemDefinition.h +++ b/Project Reboot 3.0/FortItemDefinition.h @@ -58,4 +58,13 @@ public: { return Item; } + + + static UStruct* GetStruct() + { + static auto Struct = FindObject(L"/Script/FortniteGame.ItemAndCount"); + return Struct; + } + + static int GetStructSize() { return GetStruct()->GetPropertiesSize(); } }; \ No newline at end of file diff --git a/Project Reboot 3.0/GameModeBase.cpp b/Project Reboot 3.0/GameModeBase.cpp index 31be738..4b0dbbc 100644 --- a/Project Reboot 3.0/GameModeBase.cpp +++ b/Project Reboot 3.0/GameModeBase.cpp @@ -193,8 +193,8 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll for (int i = 0; i < StartingItems.Num(); ++i) { - auto& StartingItem = StartingItems.at(i); - + auto& StartingItem = StartingItems.at(i, FItemAndCount::GetStructSize()); + LOG_INFO(LogDev, "Adding starting item {} x{}!", StartingItem.GetItem() ? StartingItem.GetItem()->GetFullName() : "BadRead", StartingItem.GetCount()); WorldInventory->AddItem(StartingItem.GetItem(), nullptr, StartingItem.GetCount()); } diff --git a/Project Reboot 3.0/bots.h b/Project Reboot 3.0/bots.h index ab600d7..94a9e40 100644 --- a/Project Reboot 3.0/bots.h +++ b/Project Reboot 3.0/bots.h @@ -140,7 +140,7 @@ public: for (int i = 0; i < StartingItems.Num(); ++i) { - auto& StartingItem = StartingItems.at(i); + auto& StartingItem = StartingItems.at(i, FItemAndCount::GetStructSize()); (*Inventory)->AddItem(StartingItem.GetItem(), nullptr, StartingItem.GetCount()); }