diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs index ef0e8ad..8831540 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs @@ -37,6 +37,7 @@ namespace RJW_Menstruation // But it is possible that there is no new hediff (be it a birth, miscarrage, or dev edit) base.CompPostPostRemoved(); + // Send the babies from this comp to the new one switch (parent) { case Hediff_Pregnant hediff_Pregnant: @@ -70,7 +71,7 @@ namespace RJW_Menstruation public void AddNewBaby(Pawn mother, Pawn father) { if (babies == null) babies = new List(); - PawnKindDef babyPawnKind = PregnancyCommon.BabyPawnKindDecider(mother, father); + PawnKindDef babyPawnKind = PregnancyCommon.BabyPawnKindDecider(mother, father, true); PawnGenerationRequest request = new PawnGenerationRequest ( kind: babyPawnKind, @@ -115,7 +116,7 @@ namespace RJW_Menstruation baby.story.furDef = firstbaby.story.furDef; } - if (baby.genes != null && ModsConfig.BiotechActive) + if (baby.genes != null) { baby.genes.SetXenotypeDirect(firstbaby.genes.Xenotype); baby.genes.xenotypeName = firstbaby.genes.xenotypeName; diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 67b4820..0d44d2e 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -313,7 +313,7 @@ namespace RJW_Menstruation allowAddictions: false, relationWithExtraPawnChanceFactor: 0, fixedLastName: lastname, - kind: PregnancyCommon.BabyPawnKindDecider(mother, father), + kind: PregnancyCommon.BabyPawnKindDecider(mother, father, false), //fixedIdeo: mother.Ideo, forbidAnyTitle: true, forceNoBackstory: true, diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs index b642947..633c8a1 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs @@ -61,7 +61,8 @@ namespace RJW_Menstruation /// /// - public static PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father) + /// + public static PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father, bool noAnimalsFromHumanlikes) { PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother); PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father); @@ -177,6 +178,12 @@ namespace RJW_Menstruation if (!spawn_kind_def_list.NullOrEmpty()) spawn_kind_def = spawn_kind_def_list.RandomElement(); } + // If both parents are humanlike, Biotech will attempt to assign genes to the child + // Normally not a problem, but with the hybrid system, two humanlikes might produce an animal + // So override it and force the child to be human + if (noAnimalsFromHumanlikes && mother.genes != null && father?.genes != null && !spawn_kind_def.race.race.Humanlike) + spawn_kind_def = Rand.Chance(RJWPregnancySettings.humanlike_DNA_from_mother) ? motherKindDef : fatherKindDef; + return spawn_kind_def; }