1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 14:53:30 +08:00

Support for DSP 0.10

This commit is contained in:
2023-12-15 20:59:48 +08:00
parent aae771d730
commit d4b1ea93c8
37 changed files with 377 additions and 126 deletions

View File

@@ -84,10 +84,10 @@ public static class PlanetPatch
var matcher = new CodeMatcher(instructions, generator);
matcher.MatchForward(false,
new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(Player), "get_sandCount"))
).Advance(3).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I4_0),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), "Max", new[] { typeof(int), typeof(int) }))
).Advance(1).RemoveInstructions(3);
).Advance(4).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I8, 0L),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), "Max", new[] { typeof(long), typeof(long) }))
).Advance(1).RemoveInstructions(4);
return matcher.InstructionEnumeration();
}
}