diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index 5628f9d..a8e873f 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -395,23 +395,10 @@ namespace RJW_Menstruation public static HediffComp_Menstruation.EstrusLevel HighestEstrus(this Pawn pawn) { - HediffComp_Menstruation.EstrusLevel res = HediffComp_Menstruation.EstrusLevel.None; - - foreach(HediffComp_Menstruation comp in pawn.GetMenstruationComps()) - { - switch (comp.GetEstrusLevel()) - { - case HediffComp_Menstruation.EstrusLevel.None: - break; - case HediffComp_Menstruation.EstrusLevel.Concealed: - res = HediffComp_Menstruation.EstrusLevel.Concealed; - break; - case HediffComp_Menstruation.EstrusLevel.Visible: - return HediffComp_Menstruation.EstrusLevel.Visible; - } - } - - return res; + return pawn.GetMenstruationComps(). + Select(comp => comp.GetEstrusLevel()). + DefaultIfEmpty(HediffComp_Menstruation.EstrusLevel.None). + Max(); } public static bool HasIUD(this Pawn pawn)