Skip to content

Commit 7669b6d

Browse files
committed
Il2Cpp: Fix OnInstallUnityTlsInterface not being static
This causes crashes in some games (likely because of mono generating thisptr arg which could break the stack order on x86)
1 parent 3f172db commit 7669b6d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

BepInEx.IL2CPP/IL2CPPChainloader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public override void Initialize(string gameExePath = null)
9494
PreloaderLogger.Log.Log(LogLevel.Debug, "Runtime invoke patched");
9595
}
9696

97-
private void OnInstallUnityTlsInterface(IntPtr unityTlsInterfaceStruct)
97+
private static void OnInstallUnityTlsInterface(IntPtr unityTlsInterfaceStruct)
9898
{
9999
Logger.Log(LogLevel.Debug, $"Captured UnityTls interface at {unityTlsInterfaceStruct.ToInt64():x8}");
100100
Il2CppTlsAdapter.Options.UnityTlsInterface = unityTlsInterfaceStruct;
@@ -157,7 +157,7 @@ public override BasePlugin LoadPlugin(PluginInfo pluginInfo, Assembly pluginAsse
157157
{
158158
var type = pluginAssembly.GetType(pluginInfo.TypeName);
159159

160-
var pluginInstance = (BasePlugin) Activator.CreateInstance(type);
160+
var pluginInstance = (BasePlugin)Activator.CreateInstance(type);
161161

162162
pluginInstance.Load();
163163

0 commit comments

Comments
 (0)