Skip to content

Commit

Permalink
-Fixed second half of PLFluffyOven.Update() transpiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonFire47 committed Jul 7, 2021
1 parent 0fa475d commit edb4301
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,12 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
new CodeInstruction(OpCodes.Callvirt, AccessTools.Method(typeof(PLFBRecipeModule), "GetBiscuitTypeToProduce")),
new CodeInstruction(OpCodes.Ldc_I4_0),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(PLPawnItem), "CreateFromInfo")),
new CodeInstruction(OpCodes.Isinst)
};
PatchMethodArrayindex = generator.DeclareLocal(typeof(int[])).LocalIndex;
List<CodeInstruction> injectedSequence2 = new List<CodeInstruction>()
{
new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ServerTakeBiscuitPatch), "PatchMethod")),
new CodeInstruction(OpCodes.Stloc_S, PatchMethodArrayindex),
Expand All @@ -294,7 +296,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Items.ItemPluginManager), "CreatePawnItem"))
};

return PatchBySequence(instructions, targetSequence, injectedSequence, patchMode: PatchMode.REPLACE, checkMode: CheckMode.NONNULL);
return PatchBySequence(firstModified, targetSequence2, injectedSequence2, patchMode: PatchMode.REPLACE, checkMode: CheckMode.NONNULL);
}
}
}

0 comments on commit edb4301

Please sign in to comment.