Skip to content

Commit b50a18a

Browse files
authored
Merge pull request #376 from Kasuromi/master
[Il2Cpp] Convert managed bool to byte in Native to Managed trampoline
2 parents b7a05a6 + bf7b059 commit b50a18a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

BepInEx.IL2CPP/Hook/IL2CPPDetourMethodPatcher.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ private static Type ConvertManagedTypeToIL2CPPType(Type managedType)
333333
) // General reference type
334334
{
335335
return typeof(IntPtr);
336+
} else if(managedType == typeof(bool)) {
337+
// bool is byte in Il2Cpp, but int in CLR => force size to be correct
338+
return typeof(byte);
336339
}
337340

338341
return managedType;

0 commit comments

Comments
 (0)