Use GoNextStage more to properly reset curStageHrs

This commit is contained in:
lutepickle 2023-03-02 14:42:49 -08:00
parent 69934d06f5
commit 5abdf52dbe
3 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -673,12 +673,12 @@ namespace RJW_Menstruation
if (Pregnancy != null && curStage != Stage.Pregnant) if (Pregnancy != null && curStage != Stage.Pregnant)
{ {
Log.Warning($"{Pawn}'s womb has a pregnancy, but was not in the pregnant stage"); Log.Warning($"{Pawn}'s womb has a pregnancy, but was not in the pregnant stage");
curStage = Stage.Pregnant; GoNextStage(Stage.Pregnant);
} }
BeforeSimulator(); BeforeSimulator();
if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) curStage = Stage.Infertile; if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) GoNextStage(Stage.Infertile);
switch (curStage) switch (curStage)
{ {
case Stage.Follicular: case Stage.Follicular:
@ -1799,7 +1799,7 @@ namespace RJW_Menstruation
return (int)(Props.recoveryIntervalDays * 24 * Rand.Range(0.95f, 1.05f)); return (int)(Props.recoveryIntervalDays * 24 * Rand.Range(0.95f, 1.05f));
case Stage.Pregnant: case Stage.Pregnant:
return (int)MenstruationUtility.GestationHours(pregnancy); return (int)MenstruationUtility.GestationHours(pregnancy);
default: // Often unused default:
return 1; return 1;
} }
} }

View File

@ -33,7 +33,7 @@ namespace RJW_Menstruation
// Make the cutoff halfway into cycle, just to be sure there isn't a double-cycle the first time // Make the cutoff halfway into cycle, just to be sure there isn't a double-cycle the first time
if ((curStage == Stage.Follicular || curStage == Stage.Luteal || curStage == Stage.Bleeding) if ((curStage == Stage.Follicular || curStage == Stage.Luteal || curStage == Stage.Bleeding)
&& (averageCycleIntervalHours - hoursToNextCycle) / 2 >= 24 * (Props.follicularIntervalDays + Props.lutealIntervalDays) / cycleSpeed) && (averageCycleIntervalHours - hoursToNextCycle) / 2 >= 24 * (Props.follicularIntervalDays + Props.lutealIntervalDays) / cycleSpeed)
curStage = Stage.Anestrus; GoNextStage(Stage.Anestrus);
} }
} }