diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll index 7395d1b..82593ee 100644 Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs index e7eaf60..57d6e5a 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs @@ -210,16 +210,25 @@ namespace RJW_Menstruation protected long CalculateLastBirth() { long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either - - if ((Pawn.relations == null)) return youngestAge; - - bool hasChild = Pawn.relations.Children. - Where(child => !Pawn.health.hediffSet.GetHediffs().Any(preg => preg.babies.Contains(child))). // no fetuses - Where(child => child.GetMother() == Pawn). // not Dad - TryMinBy(child => child.ageTracker.AgeBiologicalTicks, out Pawn youngest); - - if (hasChild) youngestAge = Pawn.ageTracker.AgeBiologicalTicks - youngest.ageTracker.AgeBiologicalTicks; - + if ((Pawn.relations?.ChildrenCount ?? 0) > 0) + { + foreach (Pawn child in Pawn.relations.Children) + { + bool isFetus = false; + if (Pawn.health.hediffSet.GetHediffs().Any(preg => preg.babies.Contains(child))) + { + isFetus = true; + break; + } + + if ( + Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth && + !isFetus && + child.GetMother() == Pawn // Don't do Dad's boobs + ) + youngestAge = Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks; + } + } return youngestAge; } @@ -328,11 +337,6 @@ namespace RJW_Menstruation } } - public void GaveBirth() - { - ageOfLastBirth = Pawn.ageTracker.AgeBiologicalTicks; - } - public void AdjustNippleProgress(float amount) { nippleProgress = Mathf.Clamp01(nippleProgress + amount); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 0f4123c..8c91cb6 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -72,7 +72,6 @@ namespace RJW_Menstruation pawn.health.RemoveHediff(this); HediffComp_Menstruation comp = this.GetMenstruationComp(); if(comp != null) comp.Pregnancy = null; - pawn.GetBreastComp()?.GaveBirth(); } public string GetBabyInfo()