-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse patches appears to be broken #111
Comments
Chiming in to say that I'm also having this problem while trying to fix another problem. With a similar setup to above, I get Invalid IL errors whenever
The following is my patch: [HarmonyPatch(typeof(PlayerInteract))]
class PlayerInteractPatch
{
[HarmonyPatch("Awake")]
[HarmonyReversePatch]
private static void AwakeReversePatch()
{
return;
}
} Patch that results in [HarmonyPatch("Awake")]
[HarmonyReversePatch]
private static void AwakeReversePatch()
{
IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var list = Transpilers.Manipulator(instructions,
item => item.opcode == OpCodes.Ldarg_0,
item =>
{
item.opcode = OpCodes.Ldarg;
item.operand = 0;
}
);
return list;
}
return;
} And finally the method being patched: |
Followup of #79 (comment).
I confirmed that this does happen on non-reorg as well (happens with v2.10.2).
The patched method looks like this:
The patch which is failing is simply returning the same instructions:
The text was updated successfully, but these errors were encountered: