mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
3 commits
a0a62ec52b
...
c402f871b6
Author | SHA1 | Date | |
---|---|---|---|
|
c402f871b6 | ||
|
def0c04838 | ||
|
153f594c93 |
2 changed files with 3 additions and 5 deletions
Binary file not shown.
|
@ -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<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> 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)
|
||||
|
|
Loading…
Reference in a new issue