Fix BabyHalfAge for races with one lifestage

This commit is contained in:
lutepickle 2022-05-13 22:01:07 -07:00
parent 41628578bb
commit f17d9110b8
4 changed files with 5 additions and 5 deletions

Binary file not shown.

View file

@ -67,12 +67,12 @@ namespace RJW_Menstruation
{ {
get get
{ {
float res = parent.pawn.RaceProps.lifeStageAges.ElementAtOrDefault(1).minAge / 2; float res;
if (res == default) List<LifeStageAge> ages = parent.pawn.RaceProps.lifeStageAges;
{ if (ages.NullOrEmpty() || ages.Count == 1)
if (Configurations.Debug) Log.Warning($"Could not find end age of baby lifestage for {parent.pawn}'s race");
res = 1.2f / 2; // Default to human res = 1.2f / 2; // Default to human
} else res = ages[1].minAge / 2;
if (RJWPregnancySettings.phantasy_pregnancy) if (RJWPregnancySettings.phantasy_pregnancy)
res /= GenDate.DaysPerYear; res /= GenDate.DaysPerYear;
return res; return res;