@@ -1893,6 +1893,15 @@ void CppGenerator::InitPredefinedMembers()
18931893 });
18941894 }
18951895
1896+ if (Off::UStruct::StructBaseChain != -1 )
1897+ {
1898+ UStructPredefs.Members .push_back ({
1899+ .Comment = " NOT AUTO-GENERATED PROPERTY" ,
1900+ .Type = " struct FStructBaseChain" , .Name = " BaseChain" , .Offset = Off::UStruct::StructBaseChain, .Size = sizeof (void *) + sizeof (int32) + sizeof (uint32) /* PAD */ , .ArrayDim = 0x1 , .Alignment = alignof (void *),
1901+ .bIsStatic = false , .bIsZeroSizeMember = false , .bIsBitField = false , .BitIndex = 0xFF
1902+ });
1903+ }
1904+
18961905 PredefinedElements& UFunctionPredefs = PredefinedMembers[ObjectArray::FindClassFast (" Function" ).GetIndex ()];
18971906 UFunctionPredefs.Members =
18981907 {
@@ -2507,11 +2516,7 @@ R"({{
25072516
25082517 PredefinedElements& UStructPredefs = PredefinedMembers[UStructIdx];
25092518
2510- UStructPredefs.Functions =
2511- {
2512- PredefinedFunction {
2513- .CustomComment = " Checks if this class has a certain base" ,
2514- .ReturnType = " bool" , .NameWithParams = " IsSubclassOf(const UStruct* Base)" , .Body =
2519+ const char * IsStructOfTypeCode =
25152520R"( {
25162521 if (!Base)
25172522 return false;
@@ -2523,7 +2528,25 @@ R"({
25232528 }
25242529
25252530 return false;
2526- })" ,
2531+ })" ;
2532+
2533+ if (Off::UStruct::StructBaseChain != -1 )
2534+ {
2535+ IsStructOfTypeCode =
2536+ R"( {
2537+ if (!Base)
2538+ return false;
2539+
2540+ const int32 NumParentStructBasesInChainMinusOne = Base->BaseChain.NumStructBasesInChainMinusOne;
2541+ return NumParentStructBasesInChainMinusOne <= BaseChain.NumStructBasesInChainMinusOne && BaseChain.StructBaseChainArray[NumParentStructBasesInChainMinusOne] == &Base->BaseChain;
2542+ })" ;
2543+ }
2544+
2545+ UStructPredefs.Functions =
2546+ {
2547+ PredefinedFunction {
2548+ .CustomComment = " Checks if this class has a certain base" ,
2549+ .ReturnType = " bool" , .NameWithParams = " IsSubclassOf(const UStruct* Base)" , .Body = IsStructOfTypeCode,
25272550 .bIsStatic = false , .bIsConst = true , .bIsBodyInline = false
25282551 },
25292552 PredefinedFunction {
@@ -4697,6 +4720,28 @@ class TSubclassOf
46974720};
46984721)" ;
46994722
4723+ /* struct FStructBaseChain */
4724+ PredefinedStruct FStructBaseChain = PredefinedStruct{
4725+ .UniqueName = " FStructBaseChain" , .Size = sizeof (void *) + sizeof (int32), .Alignment = alignof (void *), .bUseExplictAlignment = false , .bIsFinal = false , .bIsClass = false , .bIsUnion = false , .Super = nullptr
4726+ };
4727+
4728+ FStructBaseChain.Properties =
4729+ {
4730+ PredefinedMember {
4731+ .Comment = " NOT AUTO-GENERATED PROPERTY" ,
4732+ .Type = " FStructBaseChain**" , .Name = " StructBaseChainArray" , .Offset = 0x0 , .Size = sizeof (void *), .ArrayDim = 0x1 , .Alignment = alignof (void *),
4733+ .bIsStatic = false , .bIsZeroSizeMember = false , .bIsBitField = false , .BitIndex = 0xFF
4734+ },
4735+ PredefinedMember {
4736+ .Comment = " NOT AUTO-GENERATED PROPERTY" ,
4737+ .Type = " int32" , .Name = " NumStructBasesInChainMinusOne" , .Offset = sizeof (void *), .Size = sizeof (int32), .ArrayDim = 0x1 , .Alignment = alignof (void *),
4738+ .bIsStatic = false , .bIsZeroSizeMember = false , .bIsBitField = false , .BitIndex = 0xFF
4739+ },
4740+ };
4741+
4742+ GenerateStruct (&FStructBaseChain, BasicHpp, BasicCpp, BasicHpp, AssertionsFile);
4743+
4744+
47004745 const int32 TextDataSize = (Off::InSDK::Text::InTextDataStringOffset + sizeof (FString));
47014746
47024747 /* class FTextData */
@@ -4713,7 +4758,8 @@ class TSubclassOf
47134758 },
47144759 };
47154760
4716- BasicHpp << R"( namespace FTextImpl
4761+ BasicHpp << R"(
4762+ namespace FTextImpl
47174763{)" ;
47184764 GenerateStruct (&FTextData, BasicHpp, BasicCpp, BasicHpp, AssertionsFile);
47194765 BasicHpp << " }\n " ;
0 commit comments