diff --git a/BepInEx.IL2CPP/Hook/IL2CPPDetourMethodPatcher.cs b/BepInEx.IL2CPP/Hook/IL2CPPDetourMethodPatcher.cs index 7d1e62b..c76a931 100644 --- a/BepInEx.IL2CPP/Hook/IL2CPPDetourMethodPatcher.cs +++ b/BepInEx.IL2CPP/Hook/IL2CPPDetourMethodPatcher.cs @@ -333,6 +333,9 @@ public unsafe class IL2CPPDetourMethodPatcher : MethodPatcher ) // General reference type { return typeof(IntPtr); + } else if(managedType == typeof(bool)) { + // bool is byte in Il2Cpp, but int in CLR => force size to be correct + return typeof(byte); } return managedType;