From 3bdf881533669a9516051cb9d9b01694a9bc3336 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sat, 13 Apr 2024 05:39:08 -0700 Subject: [PATCH 1/2] Only apply active genes --- .../RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 733e865..706525a 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -658,7 +658,7 @@ namespace RJW_Menstruation opcache = -1; if (Pawn.genes == null || !ModsConfig.BiotechActive) return; - foreach (MenstruationModExtension extension in Pawn.genes.GenesListForReading.Select(gene => gene.def.GetModExtension()).Where(ext => ext != null)) + foreach (MenstruationModExtension extension in Pawn.genes.GenesListForReading.Where(gene => gene.Active).Select(gene => gene.def.GetModExtension()).Where(ext => ext != null)) { eggLifeSpanTicks = (int)(eggLifeSpanTicks * extension.eggLifeTimeFactor); if (extension.alwaysEstrus) estrusLevel = EstrusLevel.Visible; From c93ae8969580e036a46ee4fb142e66e4ab75d8ea Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sat, 13 Apr 2024 10:46:40 -0700 Subject: [PATCH 2/2] Properly ensure that graphics are established before copying twins --- .../HediffComps/HediffComp_PregeneratedBabies.cs | 5 ++++- .../RJW_Menstruation/Hediff_MultiplePregnancy.cs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs index 48078a1..debbb75 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs @@ -94,7 +94,10 @@ namespace RJW_Menstruation Pawn baby = PawnGenerator.GeneratePawn(request); if (baby == null) break; PregnancyCommon.SetupBabyXenotype(mother, father, baby); // Probably redundant with Biotech post-birth xenotyping -// baby.Drawer.renderer.graphics.ResolveAllGraphics(); + // HAR and some xenotype mods don't randomize graphics until it's rendered + // So poke it early + baby.Drawer.renderer.renderTree.EnsureInitialized(PawnRenderFlags.DrawNow); + if (division > 1) { if (i == 0) diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 4a71ac0..cf3fbbb 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -332,7 +332,8 @@ namespace RJW_Menstruation PregnancyCommon.SetupBabyXenotype(mother, father, baby); // HAR and some xenotype mods don't randomize graphics until it's rendered // So poke it early -// baby.Drawer.renderer.graphics.ResolveAllGraphics(); + baby.Drawer.renderer.renderTree.EnsureInitialized(PawnRenderFlags.DrawNow); + if (division > 1) { if (i == 0)