Add a check for BabyHalfAge <= 0, just to be sure

This commit is contained in:
lutepickle 2022-05-13 22:08:24 -07:00
parent f17d9110b8
commit 109cde7c55
2 changed files with 6 additions and 4 deletions

Binary file not shown.

View File

@ -67,14 +67,16 @@ namespace RJW_Menstruation
{
get
{
float res;
float res = 0;
List<LifeStageAge> ages = parent.pawn.RaceProps.lifeStageAges;
if (ages.NullOrEmpty() || ages.Count == 1)
res = 1.2f / 2; // Default to human
else res = ages[1].minAge / 2;
if (ages?.Count > 1)
res = ages[1].minAge / 2;
if (res <= 0) res = 1.2f / 2; // Default to human
if (RJWPregnancySettings.phantasy_pregnancy)
res /= GenDate.DaysPerYear;
return res;
}
}