From ea7b8e03ee698b61c5f91e6168002908096c690d Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Mon, 11 Jul 2022 19:39:41 -0700 Subject: [PATCH] Slight refactor of GetFertileMenstruationComp --- .../RJW_Menstruation/HediffComps/MenstruationUtility.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index 361006a..4fbdbce 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -41,9 +41,7 @@ namespace RJW_Menstruation public static HediffComp_Menstruation GetFertileMenstruationComp(this Pawn pawn) { List 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)