Hello,
I’ve upgraded to UE5.3 and resolved all the compatibility issues. Brought the project to build without any other issues but this and last one.
From my study it seems to stem from the changes brought to the FStructPropertyParams inside UObjectGlobals.h. More precisely the fact that the Offset member is now uint16.
My use case is the following:
I have a simple UObject based class named USkylakeStyleSet_HUD, this class has a lost of UPROPERTY, nothing fancy.
UCLASS()
class SKYLAKECLIENT_API USkylakeStyleSet_HUD : public UObject
{
GENERATED_BODY()
public:
USkylakeStyleSet_HUD(const FObjectInitializer& ObjectInitializer);
UPROPERTY(EditAnywhere, Category = "MainStatsBarWindow")
USlateBrushAsset* MainStatsBar_Center;
UPROPERTY(EditAnywhere, Category = "MainStatsBarWindo w")
USlateBrushAsset* MainStatsBar_HealthBar_Bg;
UPROPERTY(EditAnywhere, Category = "MainStatsBarWindow")
USlateBrushAsset* MainStatsBar_HealthBar_Fg;
...
As soon as i increase the number of properties in this (or any of my other similar classes) i get this build issue [warning C4305: ‘initializing’: truncation from ‘size_t’ to ‘uint16’].
This issues is reported in the generated cpp file for this class at the line where a FStructPropertyParams is declared for one of the members of my class.
Eg. line:
const UECodeGen_Private::FStructPropertyParams Z_Construct_UClass_USkylakeStyleSet_HUD_Statics::NewProp_Another_Property_2_17 = { "Another_Property_2_17", nullptr, (EPropertyFlags)0x0010000000000001, UECodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, nullptr, nullptr, 1, STRUCT_OFFSET(USkylakeStyleSet_HUD, Another_Property_2_17), Z_Construct_UScriptStruct_FCheckBoxStyle, METADATA_PARAMS(UE_ARRAY_COUNT(Z_Construct_UClass_USkylakeStyleSet_HUD_Statics::NewProp_Another_Property_2_17_MetaData), Z_Construct_UClass_USkylakeStyleSet_HUD_Statics::NewProp_Another_Property_2_17_MetaData) }; // 2749292455
It looks like
STRUCT_OFFSET(USkylakeStyleSet_HUD, Another_Property_2_17)
returns a size_t value as the offset of this property inside my class and so it overflows the uint16 property.
Is there a fix for this, or do i have to just lower the number of UPROPERties in my class?
Thank you!