Slight refactor of GetFertileMenstruationComp

This commit is contained in:
lutepickle 2022-07-11 19:39:41 -07:00
parent 931b974bf9
commit ea7b8e03ee
1 changed files with 1 additions and 3 deletions

View File

@ -41,9 +41,7 @@ namespace RJW_Menstruation
public static HediffComp_Menstruation GetFertileMenstruationComp(this Pawn pawn)
{
List<HediffComp_Menstruation> comps = pawn.GetMenstruationComps().ToList();
HediffComp_Menstruation comp = comps.Where(c => c.IsDangerDay).RandomElementWithFallback();
if (comp == null) return comps.RandomElementWithFallback();
else return comp;
return comps.Where(c => c.IsDangerDay).RandomElementWithFallback() ?? comps.RandomElementWithFallback();
}
public static HediffComp_Menstruation GetMenstruationComp(this Hediff hediff)