HarmonyX
HarmonyX copied to clipboard
Wrong decode Bge_Un_S, decoding as Bge_Un ...
Use this patch function, original Harmony - ok, HarmonyX - failed ... After debugger - HarmonyX decode Bge_Un_S as Bge_Un ...
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
return new CodeMatcher(instructions)
.MatchEndForward(
new CodeMatch(i => i.opcode == OpCodes.Ldsfld && ((FieldInfo)i.operand).Name == "worldSurface"),
// new CodeMatch(OpCodes.Bge_Un_S),
new CodeMatch(OpCodes.Bge_Un),
new CodeMatch(OpCodes.Ret))
.ThrowIfInvalid("MinecartDiggerHelper.TryDigging(): Error! Can't find pattern!")
.SetAndAdvance(OpCodes.Nop, null)
.InstructionEnumeration();
}