1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 21:33:28 +08:00

minor fix

This commit is contained in:
2024-05-24 00:16:20 +08:00
parent c7b5303da2
commit 6cc44af8e3

View File

@@ -1794,12 +1794,13 @@ 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.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.inhandItemCount))), new CodeInstruction(OpCodes.Ldloc_1).WithLabels(labels),
inst new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.inhandItemCount))),
); inst
);
return matcher.InstructionEnumeration(); return matcher.InstructionEnumeration();
} }