diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 97337d7..85e2d73 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/MilkModule/Assemblies/MilkModule.dll b/1.4/MilkModule/Assemblies/MilkModule.dll index 1881466..c56319f 100644 Binary files a/1.4/MilkModule/Assemblies/MilkModule.dll and b/1.4/MilkModule/Assemblies/MilkModule.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 1ec178c..2bdf2bd 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1610,7 +1610,6 @@ namespace RJW_Menstruation eggs.Add(new Egg((int)(EggLifespanHours / CycleFactor))); ++ovulated; } - ovarypower -= ovulated; eggstack = 0; if (Configurations.Debug && ovulated != toOvulate) 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 df6584b..6a75e94 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 @@ -192,21 +192,27 @@ namespace RJW_Menstruation } } - [HarmonyPatch(typeof(Pawn_GeneTracker), "AddGene", new Type[] {typeof(Gene), typeof(bool)})] + [HarmonyPatch(typeof(Pawn_GeneTracker), "AddGene", new Type[] { typeof(Gene), typeof(bool) })] public class AddGene_Patch { public static bool Prefix(ref Gene __result, Gene gene, Pawn ___pawn) { - if(VariousDefOf.WombGenes.Contains(gene.def) && !___pawn.GetMenstruationComps().Any()) + if (!VariousDefOf.WombGenes.Contains(gene.def)) return true; + bool keepGene; + if (PawnGenerator.IsBeingGenerated(___pawn)) { - __result = null; - return false; + // During pawn generation, the vagina hediff doesn't exist yet + // So use gender to decide instead + // Not the most accurate, but close enough + keepGene = ___pawn.gender == Gender.Female; } - else return true; + else keepGene = ___pawn.GetMenstruationComps().Any(); + if (!keepGene) __result = null; + return keepGene; } } - [HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")] + [HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")] public class Notify_GenesChanged_Patch { public static void Postfix(Pawn_GeneTracker __instance) diff --git a/changelogs.txt b/changelogs.txt index 42f00cd..16390f2 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,4 +1,5 @@ Version 1.0.9.0 + - Menstruation-related genes will now stay on females during initial pawn setup. Version 1.0.8.9 - Fix bug that sent pawns into menopause very early. Please use the recalculate ovary power dev action to restore lost eggs.