Closed SamboyCoding closed 1 year ago
++ from me on the importance of this issue. It directly impacts https://github.com/doombubbles/ultimate-crosspathing (one of the most prominent BTD6 mods) and necessitates some very unsustainable workarounds.
Fixed in 44f18f02fc95ebd225a43272fbe53f48aa9ac113.
There is a logic error in this section of code: https://github.com/BepInEx/Il2CppInterop/blob/master/Il2CppInterop.Runtime/Il2CppClassPointerStore.cs#L45-L51
which means any Enum types in Il2Cpp-prefixed namespaces get their class pointer set to 0, which leads to exceptions in the) with an enum type as any of the generic arguments, and also breaks accessing game classes which use fields of such a type.
hkClassFromIl2CppType
patch because the type pointer is 0x20 (0 plus the offset of the relevant field, I presume). These are easily observed by trying to use any il2cpp generic type (e.g. ListThe exception comes across as something like this:
though the actual callstack dips in and out of native code a bit more than that:![image](https://user-images.githubusercontent.com/7011721/208526853-1c32dd0f-13ea-4059-93eb-de3afbdb9907.png)
The linked code needs to check for, and remove, any il2cpp prefix that isn't in the il2cpp metadata.