From 8e9acaa8ca4d516e715af320fe7a5815742bf55d Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Tue, 9 Jan 2024 10:26:28 -0800 Subject: [PATCH] Little refactor in ShouldCycle --- .../RJW_Menstruation/HediffComps/MenstruationUtility.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index ae87a94..95901c6 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -397,11 +397,8 @@ namespace RJW_Menstruation { if (!Configurations.EnableAnimalCycle && pawn.IsAnimal()) return false; if (pawn.RaceHasOviPregnancy()) return false; - if (ModsConfig.BiotechActive && pawn.genes != null) - { - foreach (GeneDef geneDef in pawn.genes.GenesListForReading.Select(gene => gene.def)) - if (VariousDefOf.EggLayerGenes.Contains(geneDef)) return false; - } + if (ModsConfig.BiotechActive && pawn.genes != null && + pawn.genes.GenesListForReading.Select(gene => gene.def).Intersect(VariousDefOf.EggLayerGenes).Any()) return false; return true; }