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