Compare commits

..

No commits in common. "c402f871b64ecef94613b68cbc696c2b2557ada2" and "a0a62ec52b6a771f5dfda60d93b2889f7b662cbb" have entirely different histories.

2 changed files with 5 additions and 3 deletions

Binary file not shown.

View file

@ -56,7 +56,7 @@ namespace RJW_Menstruation
pushingcomp.babies = this.babies;
pushingcomp.enzygoticSiblings = this.enzygoticSiblings;
break;
case Hediff_LaborPushing _:
case Hediff_LaborPushing hediff_LaborPushing:
// Nothing to do, the laborpushing transpiler will pick it up
break;
}
@ -175,11 +175,13 @@ namespace RJW_Menstruation
return baby;
}
private static readonly MethodInfo ApplyBirthOutcome = typeof(PregnancyUtility).GetMethod(nameof(PregnancyUtility.ApplyBirthOutcome));
private static readonly int birtherThing = ApplyBirthOutcome.GetParameters().FirstIndexOf(parameter => parameter.Name == "birtherThing" && parameter.ParameterType == typeof(Thing));
private static readonly MethodInfo GeneratePawn = typeof(PawnGenerator).GetMethod(nameof(PawnGenerator.GeneratePawn), new Type[] {typeof (PawnGenerationRequest)});
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase original)
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
bool methodPatched = false;
int birtherThing = original.GetParameters().FirstIndexOf(parameter => parameter.Name == "birtherThing" && parameter.ParameterType == typeof(Thing));
if (birtherThing < 0) throw new InvalidOperationException("Could not locate index of birtherThing");
if (GeneratePawn?.ReturnType != typeof(Pawn)) throw new InvalidOperationException("GeneratePawn not found");
foreach (CodeInstruction instruction in instructions)