124 files changed.

This commit is contained in:
Milxnor
2023-04-15 19:53:58 -04:00
parent 63473de425
commit bbf28ed9e9
124 changed files with 60988 additions and 577 deletions

View File

@@ -89,6 +89,24 @@ struct FFortItemEntry : FFastArraySerializerItem
return *(int*)(__int64(this) + LoadedAmmoOffset);
}
void CopyFromAnotherItemEntry(FFortItemEntry* OtherItemEntry, bool bCopyGuid = false)
{
auto OldGuid = this->GetItemGuid();
if (false)
{
CopyStruct(this, OtherItemEntry, FFortItemEntry::GetStructSize(), FFortItemEntry::GetStruct());
}
else
{
this->GetItemDefinition() = OtherItemEntry->GetItemDefinition();
this->GetCount() = OtherItemEntry->GetCount();
this->GetLoadedAmmo() = OtherItemEntry->GetLoadedAmmo();
}
this->GetItemGuid() = OldGuid;
}
static UStruct* GetStruct()
{
static auto Struct = FindObject<UStruct>("/Script/FortniteGame.FortItemEntry");
@@ -103,11 +121,16 @@ struct FFortItemEntry : FFastArraySerializerItem
static FFortItemEntry* MakeItemEntry(UFortItemDefinition* ItemDefinition, int Count = 1, int LoadedAmmo = 0)
{
auto Entry = Alloc<FFortItemEntry>(GetStructSize());
auto Entry = // (FFortItemEntry*)FMemory::Realloc(0, GetStructSize(), 0);
Alloc<FFortItemEntry>(GetStructSize());
if (!Entry)
return nullptr;
Entry->MostRecentArrayReplicationKey = -1;
Entry->ReplicationID = -1;
Entry->ReplicationKey = -1;
Entry->GetItemDefinition() = ItemDefinition;
Entry->GetCount() = Count;
Entry->GetLoadedAmmo() = LoadedAmmo;
@@ -122,7 +145,7 @@ public:
FFortItemEntry* GetItemEntry()
{
static auto ItemEntryOffset = this->GetOffset("ItemEntry");
return &Get<FFortItemEntry>(ItemEntryOffset);
return GetPtr<FFortItemEntry>(ItemEntryOffset);
}
void SetOwningControllerForTemporaryItem(UObject* Controller);