Add checks for ShouldCycle into the birth transpilers

This commit is contained in:
lutepickle 2024-05-16 20:10:58 -07:00
parent 2d1404fcba
commit afcb7bf7c5
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -157,7 +157,7 @@ namespace RJW_Menstruation
// Easier to work out twins that way
// From e.g. a vat
if (!(birtherThing is Pawn mother) || !xxx.is_human(mother))
if (!(birtherThing is Pawn mother) || !xxx.is_human(mother) || !mother.ShouldCycle())
return PawnGenerator.GeneratePawn(request);
// No babies found. Could be an unmodified pregnancy
@ -200,7 +200,7 @@ namespace RJW_Menstruation
{
private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List<GeneDef> genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments, bool preventLetter)
{
if (birtherThing is Pawn mother)
if (birtherThing is Pawn mother && mother.ShouldCycle())
{
HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff<Hediff_LaborPushing>().TryGetComp<HediffComp_PregeneratedBabies>();
if (comp?.HasBaby ?? false)
@ -256,7 +256,7 @@ namespace RJW_Menstruation
{
private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List<GeneDef> genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments)
{
if (birtherThing is Pawn mother)
if (birtherThing is Pawn mother && mother.ShouldCycle())
{
HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff<Hediff_LaborPushing>().TryGetComp<HediffComp_PregeneratedBabies>();
if (comp?.HasBaby ?? false)