fix da crash

This commit is contained in:
Milxnor
2023-03-23 22:59:19 -04:00
parent 757f7b21d3
commit 7d21fef63a
4 changed files with 17 additions and 5 deletions

View File

@@ -387,13 +387,17 @@ AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldHook(UObject* Context, FFr
bool UFortKismetLibrary::PickLootDropsHook(UObject* Context, FFrame& Stack, bool* Ret)
{
static auto WorldContextObjectOffset = FindOffsetStruct("/Script/FortniteGame.FortKismetLibrary.PickLootDrops", "WorldContextObject", false);
UObject* WorldContextObject; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<FFortItemEntry> OutLootToDropTempBuf; // (Parm, OutParm, ZeroConstructor, NativeAccessSpecifierPublic)
FName TierGroupName; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int WorldLevel; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int ForcedLootTier; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
Stack.StepCompiledIn(&WorldContextObject);
if (WorldContextObjectOffset != 0)
Stack.StepCompiledIn(&WorldContextObject);
auto& OutLootToDrop = Stack.StepCompiledInRef<TArray<FFortItemEntry>>(&OutLootToDropTempBuf);
Stack.StepCompiledIn(&TierGroupName);
Stack.StepCompiledIn(&WorldLevel);
@@ -403,6 +407,12 @@ bool UFortKismetLibrary::PickLootDropsHook(UObject* Context, FFrame& Stack, bool
auto LootDrops = PickLootDrops(TierGroupName, true);
/* LootDrop skuffed{};
skuffed.ItemDefinition = FindObject<UFortItemDefinition>("AGID_CarminePack", nullptr, ANY_PACKAGE);
skuffed.Count = 1;
LootDrops.push_back(skuffed); */
for (int i = 0; i < LootDrops.size(); i++)
{
auto NewEntry = Alloc<FFortItemEntry>(FFortItemEntry::GetStructSize());