mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
a bit
fix some bug with remvoing items, add experimental stat saving for gadgets, fix shadow stones scuffy
This commit is contained in:
@@ -71,6 +71,20 @@ public:
|
||||
ArrayMax = v3;
|
||||
}
|
||||
|
||||
int AddUnitialized2(SIZE_T NumBytesPerElement = sizeof(InElementType))
|
||||
{
|
||||
const int OldArrayNum = ArrayNum;
|
||||
|
||||
ArrayNum = OldArrayNum + 1;
|
||||
|
||||
if (ArrayNum > ArrayMax)
|
||||
{
|
||||
ResizeArray(ArrayNum, NumBytesPerElement);
|
||||
}
|
||||
|
||||
return OldArrayNum;
|
||||
}
|
||||
|
||||
void CopyFromArray(TArray<InElementType>& OtherArray, SIZE_T NumBytesPerElement = sizeof(InElementType))
|
||||
{
|
||||
if (!OtherArray.ArrayNum && !ArrayMax)
|
||||
@@ -292,6 +306,18 @@ public:
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FreeGood(SizeType Size = sizeof(InElementType))
|
||||
{
|
||||
static void (*FreeOriginal)(void* Original) = decltype(FreeOriginal)(Addresses::Free);
|
||||
|
||||
if (FreeOriginal)
|
||||
FreeOriginal(Data);
|
||||
|
||||
Data = nullptr;
|
||||
ArrayNum = 0;
|
||||
ArrayMax = 0;
|
||||
}
|
||||
|
||||
void FreeReal(SizeType Size = sizeof(InElementType))
|
||||
{
|
||||
if (!IsBadReadPtr(Data, 8) && ArrayNum > 0 && sizeof(InElementType) > 0)
|
||||
|
||||
Reference in New Issue
Block a user