mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Have the two pregnancy progress functions return 0 on no pregnancy instead of -1
This commit is contained in:
parent
0b272c1e5b
commit
5eb73bfb2e
1 changed files with 3 additions and 3 deletions
|
@ -139,13 +139,13 @@ namespace RJW_Menstruation
|
||||||
public static float GetFarthestPregnancyProgress(this Pawn pawn)
|
public static float GetFarthestPregnancyProgress(this Pawn pawn)
|
||||||
{
|
{
|
||||||
IEnumerable<Hediff_BasePregnancy> pregnancies = pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>();
|
IEnumerable<Hediff_BasePregnancy> pregnancies = pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>();
|
||||||
if (!pregnancies.Any()) return -1;
|
if (!pregnancies.Any()) return 0;
|
||||||
else return pregnancies.MaxBy(hediff => hediff.GestationProgress)?.GestationProgress ?? -1;
|
else return pregnancies.MaxBy(hediff => hediff.GestationProgress)?.GestationProgress ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetPregnancyProgress(this HediffComp_Menstruation comp)
|
public static float GetPregnancyProgress(this HediffComp_Menstruation comp)
|
||||||
{
|
{
|
||||||
if (comp.Pregnancy == null) return -1;
|
if (comp.Pregnancy == null) return 0;
|
||||||
else return comp.Pregnancy.GestationProgress;
|
else return comp.Pregnancy.GestationProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue