|
4 | 4 |
|
5 | 5 | #include "CoreMinimal.h" |
6 | 6 | #include "Kismet/BlueprintFunctionLibrary.h" |
| 7 | +#include "Runtime/Launch/Resources/Version.h" |
| 8 | + |
7 | 9 | #include "RyRuntimeArrayHelpers.generated.h" |
8 | 10 |
|
9 | 11 | //DECLARE_DYNAMIC_DELEGATE_RetVal_TwoParams(bool, FRyGenericArraySort, const int32&, A, const int32&, B); |
@@ -43,7 +45,11 @@ class RYRUNTIME_API URyRuntimeArrayHelpers : public UBlueprintFunctionLibrary |
43 | 45 | // Since 'Item' isn't really an int, step the stack manually |
44 | 46 | // We use the array inner type to understand what we are returning (the size) |
45 | 47 | const FProperty* InnerProp = ArrayProperty->Inner; |
| 48 | +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5 |
| 49 | + const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim; |
| 50 | +#else |
46 | 51 | const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim; |
| 52 | +#endif |
47 | 53 | void* StorageSpace = FMemory_Alloca(PropertySize); |
48 | 54 | InnerProp->InitializeValue(StorageSpace); |
49 | 55 |
|
@@ -84,7 +90,11 @@ class RYRUNTIME_API URyRuntimeArrayHelpers : public UBlueprintFunctionLibrary |
84 | 90 | // Since 'Item' isn't really an int, step the stack manually |
85 | 91 | // We use the array inner type to understand what we are returning (the size) |
86 | 92 | const FProperty* InnerProp = ArrayProperty->Inner; |
| 93 | +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5 |
| 94 | + const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim; |
| 95 | +#else |
87 | 96 | const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim; |
| 97 | +#endif |
88 | 98 | void* StorageSpace = FMemory_Alloca(PropertySize); |
89 | 99 | InnerProp->InitializeValue(StorageSpace); |
90 | 100 |
|
|
0 commit comments