Skip to content

Commit

Permalink
Fix header generation when a struct contains an enum pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Dec 7, 2023
1 parent 1d28909 commit ef56ebb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ private void VisitFieldStructs(TypeInfo ti) {
if (ti.IsEnum)
VisitFieldStructs(ti.GetEnumUnderlyingType());

foreach (var fi in ti.DeclaredFields)
if (!fi.IsStatic && !fi.IsLiteral && (fi.FieldType.IsEnum || fi.FieldType.IsValueType))
foreach (var fi in ti.DeclaredFields.Where(fi => !fi.IsStatic && !fi.IsLiteral))
{
if (fi.FieldType.IsEnum || fi.FieldType.IsValueType)
VisitFieldStructs(fi.FieldType);
else if (fi.FieldType.HasElementType)
VisitFieldStructs(fi.FieldType.ElementType);
}

TodoFieldStructs.Add(ti);
}
Expand Down

0 comments on commit ef56ebb

Please sign in to comment.