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 52714ea..2257c55 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 @@ -1,4 +1,5 @@ using HarmonyLib; +using System.Linq; using RimWorld; using Verse; @@ -47,4 +48,17 @@ namespace RJW_Menstruation comp.Pregnancy = null; } } + + // Prevents a pregnancy from going into labor if another pregnancy already is + [HarmonyPatch(typeof(Hediff_Pregnant), nameof(Hediff_Pregnant.GestationProgress), MethodType.Getter)] + public class Hediff_Pregnant_GestationProgess_Patch + { + public static void PostFix(Hediff_Pregnant __instance, ref float __result) + { + if (__result < 1f) return; + Pawn pawn = __instance.pawn; + if (pawn.health.hediffSet.hediffs.Any(hediff => hediff.def == HediffDefOf.PregnancyLabor || hediff.def == HediffDefOf.PregnancyLaborPushing)) + __result = 0.999f; + } + } } \ No newline at end of file diff --git a/changelogs.txt b/changelogs.txt index 63db02c..3f3fadd 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,6 +1,7 @@ Version 1.0.8.1 - Added the option for humans to start Biotech pregnancies if the DLC is enabled. If set, non-humans will use the old multiple pregnancy instead. - Properly track biotech pregnancy through labor. + - A biotech pregnancy will pause before going into labor if another womb already is in labor. Version 1.0.8.0 - Support for RimWorld 1.4. All future changes to Menstruation will only be for Rimworld 1.4.