From 6cc44af8e390a50a402a2fc4d7b0b21e5730e8fd Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Fri, 24 May 2024 00:16:20 +0800 Subject: [PATCH] minor fix --- UXAssist/FactoryPatch.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/UXAssist/FactoryPatch.cs b/UXAssist/FactoryPatch.cs index 19f1f85..8324ced 100644 --- a/UXAssist/FactoryPatch.cs +++ b/UXAssist/FactoryPatch.cs @@ -1794,12 +1794,13 @@ public static class FactoryPatch ); var inst = matcher.InstructionAt(1).Clone(); var pos2 = matcher.Pos + 2; - matcher.Start().Advance(pos).RemoveInstructions(pos2 - pos) - .Insert( - new CodeInstruction(OpCodes.Ldloc_1), - new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.inhandItemCount))), - inst - ); + matcher.Start().Advance(pos); + var labels = matcher.Labels; + matcher.RemoveInstructions(pos2 - pos).Insert( + new CodeInstruction(OpCodes.Ldloc_1).WithLabels(labels), + new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.inhandItemCount))), + inst + ); return matcher.InstructionEnumeration(); }