mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
we love gc
This commit is contained in:
@@ -108,9 +108,11 @@ struct FFortItemEntry : FFastArraySerializerItem
|
||||
this->GetItemDefinition() = OtherItemEntry->GetItemDefinition();
|
||||
this->GetCount() = OtherItemEntry->GetCount();
|
||||
this->GetLoadedAmmo() = OtherItemEntry->GetLoadedAmmo();
|
||||
this->GetItemGuid() = OtherItemEntry->GetItemGuid();
|
||||
}
|
||||
|
||||
this->GetItemGuid() = OldGuid;
|
||||
if (!bCopyGuid)
|
||||
this->GetItemGuid() = OldGuid;
|
||||
}
|
||||
|
||||
static UStruct* GetStruct()
|
||||
@@ -144,6 +146,40 @@ struct FFortItemEntry : FFastArraySerializerItem
|
||||
|
||||
return Entry;
|
||||
}
|
||||
|
||||
// We need to find a better way for below... Especially since we can't do either method for season 5 or 6.
|
||||
|
||||
static void FreeItemEntry(FFortItemEntry* Entry)
|
||||
{
|
||||
if (Addresses::FreeEntry)
|
||||
{
|
||||
static __int64 (*FreeEntryOriginal)(__int64 Entry) = decltype(FreeEntryOriginal)(Addresses::FreeEntry);
|
||||
FreeEntryOriginal(__int64(Entry));
|
||||
}
|
||||
}
|
||||
|
||||
static void FreeArrayOfEntries(TArray<FFortItemEntry>& tarray)
|
||||
{
|
||||
if (Addresses::FreeArrayOfEntries)
|
||||
{
|
||||
static __int64 (*FreeArrayOfEntriesOriginal)(TArray<FFortItemEntry>& a1) = decltype(FreeArrayOfEntriesOriginal)(Addresses::FreeArrayOfEntries);
|
||||
FreeArrayOfEntriesOriginal(tarray);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Addresses::FreeEntry)
|
||||
{
|
||||
for (int i = 0; i < tarray.size(); i++)
|
||||
{
|
||||
FreeItemEntry(tarray.AtPtr(i));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tarray.Free(); // does nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class UFortItem : public UObject
|
||||
|
||||
Reference in New Issue
Block a user