minor fix

This commit is contained in:
2024-05-24 00:18:43 +08:00
parent c7b5303da2
commit 6cc44af8e3
+4 -3
View File
@@ -1794,9 +1794,10 @@ public static class FactoryPatch
); );
var inst = matcher.InstructionAt(1).Clone(); var inst = matcher.InstructionAt(1).Clone();
var pos2 = matcher.Pos + 2; var pos2 = matcher.Pos + 2;
matcher.Start().Advance(pos).RemoveInstructions(pos2 - pos) matcher.Start().Advance(pos);
.Insert( var labels = matcher.Labels;
new CodeInstruction(OpCodes.Ldloc_1), matcher.RemoveInstructions(pos2 - pos).Insert(
new CodeInstruction(OpCodes.Ldloc_1).WithLabels(labels),
new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.inhandItemCount))), new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.inhandItemCount))),
inst inst
); );