From 7e407a1cf9adb638396ca62d0834c8e6c351e21f Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Tue, 27 Feb 2024 14:58:20 -0800 Subject: [PATCH] Don't call Notify_UpdatedGenes if the gene isn't menstruation-related --- .../RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs index eb8777a..0f8f2b6 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs @@ -195,8 +195,9 @@ namespace RJW_Menstruation [HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")] public class Notify_GenesChanged_Patch { - public static void Postfix(Pawn_GeneTracker __instance) + public static void Postfix(Pawn_GeneTracker __instance, GeneDef addedOrRemovedGene) { + if (!addedOrRemovedGene.HasModExtension()) return; foreach (HediffComp_Menstruation comp in __instance.pawn.GetMenstruationComps()) comp.Notify_UpdatedGenes(); }