Have get_Pregnancy test to see if the pawn has the hediff. Won't happen for MultiplePregnancy, but the base pregnancy and the nonstandard ones will.

Mostly useful for the window between a pregnancy ending and the last PregnantAction firing.
This commit is contained in:
lutepickle 2022-07-25 11:45:18 -07:00
parent 0f61f0f260
commit ff039e3065

View file

@ -121,7 +121,19 @@ namespace RJW_Menstruation
protected float? originvagsize = null;
protected Hediff_BasePregnancy pregnancy = null;
public Hediff_BasePregnancy Pregnancy { get => pregnancy; set => pregnancy = value; }
public Hediff_BasePregnancy Pregnancy {
get
{
if (pregnancy == null) return null;
else if (!parent.pawn.health.hediffSet.hediffs.Contains(pregnancy))
{
pregnancy = null;
return null;
}
else return pregnancy;
}
set => pregnancy = value;
}
public int OvaryPowerThreshold
{