Skip to content

Commit

Permalink
better match for screwplatform (fixes error in ms-store ver)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMooskyFish committed Feb 22, 2024
1 parent dab0236 commit dca5f1b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions patches/ScrewPlatform_P.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ static class RotaterPatch
static IEnumerable<CodeInstruction> Patch(IEnumerable<CodeInstruction> instructions)
{
return new CodeMatcher(instructions)
.MatchForward(true,
new CodeMatch(OpCodes.Sub),
new CodeMatch(OpCodes.Br),
new CodeMatch(OpCodes.Ldc_R4),
new CodeMatch(OpCodes.Stloc_1)
).Advance(1).InsertAndAdvance(
.MatchForward(false,
new CodeMatch(OpCodes.Ldloc_0),
new CodeMatch(OpCodes.Brfalse)
).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldloc_1),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Utils), nameof(Utils.AddDeltaTime), new[] { typeof(float) })),
new CodeInstruction(OpCodes.Stloc_1)
Expand Down

0 comments on commit dca5f1b

Please sign in to comment.