Let the pregnancy detector in the initialization pick up multiple pregnancies, just in case

This commit is contained in:
lutepickle 2022-07-21 19:18:48 -07:00
parent 3f3977b3c7
commit 52b0c3ab95

View file

@ -885,13 +885,19 @@ namespace RJW_Menstruation
InitOvary(); InitOvary();
if (pregnancy == null && // If there's no pregnancy registered in this womb... if (pregnancy == null)
PregnancyHelper.GetPregnancy(parent.pawn) is Hediff_BasePregnancy preg && // ...but the pawn is pregnant... {
preg.GetMenstruationComp() == null) // ...and another womb doesn't have it, then pick it up // If this womb isn't marked pregnant, search for pregnancies that have no womb and claim one
foreach (Hediff_BasePregnancy preg in parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>())
{
if (preg.GetMenstruationComp() == null)
{ {
currentIntervalHours = (int)preg.GestationHours(); currentIntervalHours = (int)preg.GestationHours();
curStage = Stage.Pregnant; curStage = Stage.Pregnant;
pregnancy = preg; pregnancy = preg;
break;
}
}
} }
if (parent.pawn.IsAnimal()) if (parent.pawn.IsAnimal())