Do the infertile check after the simulation instead of before

This commit is contained in:
lutepickle 2024-03-16 22:35:13 -07:00
parent 2facc09926
commit 5fbed7073a

View file

@ -716,7 +716,6 @@ namespace RJW_Menstruation
BeforeSimulator();
if (ShouldBeInfertile()) GoNextStage(Stage.Infertile);
switch (curStage)
{
case Stage.Follicular:
@ -749,6 +748,7 @@ namespace RJW_Menstruation
GoNextStage(Stage.Follicular);
break;
}
AfterSimulator();
}
catch (Exception ex)
@ -1263,6 +1263,11 @@ namespace RJW_Menstruation
protected virtual void AfterSimulator()
{
if (ShouldBeInfertile())
{
eggs.Clear();
GoNextStage(Stage.Infertile);
}
if (EggHealth < 1f)
{
if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
@ -1727,11 +1732,7 @@ namespace RJW_Menstruation
{
if (curStageTicks >= currentIntervalTicks)
{
if (ShouldBeInfertile())
{
GoNextStage(Stage.Infertile);
}
else if (!IsBreedingSeason())
if (!IsBreedingSeason())
{
GoNextStage(Stage.Anestrus);
}