Skip to content

Commit

Permalink
Reverse patch hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kohanis committed May 30, 2024
1 parent 173f2f6 commit c248ad1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Harmony/Internal/PatchFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ static void PrintInfo(StringBuilder sb, ICollection<MethodInfo> methods, string
}, debug);

MethodBody patchBody = null;
var hook = new ILHook(standin.method, ctx =>
#pragma warning disable CA2000 // pinned with PatchTools.RememberObject later
var hook = new ILHook(
#pragma warning restore CA2000
standin.method, ctx =>
{
if (!(original is MethodInfo mi))
return;
Expand Down Expand Up @@ -155,7 +158,7 @@ static void PrintInfo(StringBuilder sb, ICollection<MethodInfo> methods, string
}

var replacement = hook.Method as MethodInfo;
PatchTools.RememberObject(standin.method, replacement);
PatchTools.RememberObject(standin.method, (replacement, hook));
return replacement;
}

Expand Down

0 comments on commit c248ad1

Please sign in to comment.