From 70ffef13c8b5a2dd44ce9c5a8fb97bcb0f1e906b Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Wed, 26 Jun 2024 18:47:50 +0200 Subject: [PATCH] Trying to remove Sex-Change Thoughts for Babies, fixes #103 --- CHANGELOG.md | 2 +- Source/Genes/Gender/GenderUtility.cs | 15 +++++++++++++++ Source/Genes/Gender/Gene_FemaleOnly.cs | 3 +++ Source/Genes/Gender/Gene_MaleOnly.cs | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1230d15..629613f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ - Pawns with "rjw_genes_no_sexneed" wont go raping (or atleast way less, #100) - Extra Nullcheck for Genes in Orgasmic Mytosis (#95) - Orgasmic Mytosis Pawns *should* inherit the Xenotypename and favorite colour now - +- Babies should not have "SexChangeThoughts" anymore when they had a (fe)male-only gene (#103) **Changes**: diff --git a/Source/Genes/Gender/GenderUtility.cs b/Source/Genes/Gender/GenderUtility.cs index 88aa063..15c7c02 100644 --- a/Source/Genes/Gender/GenderUtility.cs +++ b/Source/Genes/Gender/GenderUtility.cs @@ -101,5 +101,20 @@ namespace RJW_Genes pawn.health.RemoveHediff(hediff); } } + + /// + /// This check helps to get babies after birth, if the pawn was born with the gene it does not need to have thoughts. + /// There are very different ways to do the life stages, and there are also HAR people still around, + /// so instead of checking for stages I intentionally check for the biological ticks to be very low (that they can only exist basically if they are born right before). + /// Issue is tracked in #103. + /// + /// + public static void RemoveSexChangeThoughtsIfTooYoung(Pawn pawn) + { + if (pawn.ageTracker.AgeBiologicalTicks < 1000) + { + GenderUtility.RemoveAllSexChangeThoughts(pawn); + } + } } } diff --git a/Source/Genes/Gender/Gene_FemaleOnly.cs b/Source/Genes/Gender/Gene_FemaleOnly.cs index df48328..c3d5ef6 100644 --- a/Source/Genes/Gender/Gene_FemaleOnly.cs +++ b/Source/Genes/Gender/Gene_FemaleOnly.cs @@ -14,12 +14,15 @@ namespace RJW_Genes // Here we call Sexualization after the Sex-Change if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn)) Sexualizer.sexualize_pawn(pawn); + + GenderUtility.RemoveSexChangeThoughtsIfTooYoung(this.pawn); } public override void PostAdd() { base.PostMake(); AdjustPawnToFemale(); + GenderUtility.RemoveSexChangeThoughtsIfTooYoung(this.pawn); } private void AdjustPawnToFemale() diff --git a/Source/Genes/Gender/Gene_MaleOnly.cs b/Source/Genes/Gender/Gene_MaleOnly.cs index d99652a..daca649 100644 --- a/Source/Genes/Gender/Gene_MaleOnly.cs +++ b/Source/Genes/Gender/Gene_MaleOnly.cs @@ -14,12 +14,15 @@ namespace RJW_Genes // Here we call Sexualization after the Sex-Change if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn)) Sexualizer.sexualize_pawn(pawn); + + GenderUtility.RemoveSexChangeThoughtsIfTooYoung(this.pawn); } public override void PostAdd() { base.PostMake(); AdjustPawnToMale(); + GenderUtility.RemoveSexChangeThoughtsIfTooYoung(this.pawn); } private void AdjustPawnToMale()