diff --git a/1.5/Assemblies/RJW_Menstruation.dll b/1.5/Assemblies/RJW_Menstruation.dll index 84270e6..02940d1 100644 Binary files a/1.5/Assemblies/RJW_Menstruation.dll and b/1.5/Assemblies/RJW_Menstruation.dll differ diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs index a746615..2f6cea5 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs @@ -56,7 +56,7 @@ namespace RJW_Menstruation pushingcomp.babies = this.babies; pushingcomp.enzygoticSiblings = this.enzygoticSiblings; break; - case Hediff_LaborPushing hediff_LaborPushing: + case Hediff_LaborPushing _: // Nothing to do, the laborpushing transpiler will pick it up break; } @@ -175,13 +175,11 @@ 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 Transpiler(IEnumerable instructions) + public static IEnumerable Transpiler(IEnumerable instructions, MethodBase original) { 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)