From ac17a3a5105856ed062d001e2581ba2fc48a2fe1 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 14 Sep 2020 12:28:00 +0200 Subject: [PATCH] C#: Fix handling of scoped names pointing to global:: scope --- Il2CppInspector.Common/Reflection/TypeInfo.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Il2CppInspector.Common/Reflection/TypeInfo.cs b/Il2CppInspector.Common/Reflection/TypeInfo.cs index b98219a..8b40580 100644 --- a/Il2CppInspector.Common/Reflection/TypeInfo.cs +++ b/Il2CppInspector.Common/Reflection/TypeInfo.cs @@ -561,6 +561,10 @@ namespace Il2CppInspector.Reflection minimallyScopedName = mutualRootScope.Length > 0 ? usedType.Substring(mutualRootScope.Length + 1) : "global::" + usedType; } + // If the final name starts with ".", it's a reference to the global namespace (ie. unnamed root namespace) + if (minimallyScopedName.StartsWith(".")) + minimallyScopedName = "global::" + minimallyScopedName.Substring(1); + return minimallyScopedName; } @@ -873,6 +877,8 @@ namespace Il2CppInspector.Reflection declaredEvents = new List(); for (var e = Definition.eventStart; e < Definition.eventStart + Definition.event_count; e++) declaredEvents.Add(new EventInfo(pkg, e, this)); + + // TODO: Events have the same edge case issue as properties above, eg. PoGo 0.35.0 } // Initialize a type from a concrete generic instance