Remove accidental trigger of SRE types in preloader

This commit is contained in:
ghorsington committed 2019-08-23 00:41:53 +03:00
1 parent 212b8aabf6
commit d84da485aa
2 files changed
+12 -10

No files matched your search

+9 -6
View File
@@ -34,17 +34,19 @@ namespace BepInEx.Preloader
{
AllocateConsole();
Utility.TryDo(() =>
bool bridgeInitialized = Utility.TryDo(() =>
{
if (ConfigShimHarmony.Value)
HarmonyDetourBridge.Init();
}, out var harmonyBridgeException);
Utility.TryDo(() =>
{
if (ConfigApplyRuntimePatches.Value)
UnityPatches.Apply();
}, out var runtimePatchException);
Exception runtimePatchException = null;
if(bridgeInitialized)
Utility.TryDo(() =>
{
if (ConfigApplyRuntimePatches.Value)
UnityPatches.Apply();
}, out runtimePatchException);
Logger.Sources.Add(TraceLogSource.CreateSource());
@@ -100,6 +102,7 @@ namespace BepInEx.Preloader
}
catch (Exception ex)
{
File.WriteAllText("err.log", ex.ToString());
try
{
Logger.LogFatal("Could not run preloader!");
@@ -8,14 +8,13 @@ namespace BepInEx.Preloader.RuntimeFixes
{
internal static class UnityPatches
{
public static HarmonyLib.Harmony HarmonyInstance { get; } = new HarmonyLib.Harmony("com.bepinex.unitypatches");
private static HarmonyLib.Harmony HarmonyInstance { get; set; }
public static Dictionary<string, string> AssemblyLocations { get; } =
new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
public static Dictionary<string, string> AssemblyLocations { get; } = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
public static void Apply()
{
HarmonyWrapper.PatchAll(typeof(UnityPatches), HarmonyInstance);
HarmonyInstance = HarmonyWrapper.PatchAll(typeof(UnityPatches), HarmonyInstance);
try
{