diff --git a/1.5/Assemblies/RJW_Menstruation.dll b/1.5/Assemblies/RJW_Menstruation.dll index 517441c..463815e 100644 Binary files a/1.5/Assemblies/RJW_Menstruation.dll and b/1.5/Assemblies/RJW_Menstruation.dll differ 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 ef877e1..505d9be 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 @@ -21,22 +21,7 @@ namespace RJW_Menstruation public bool HasBaby { - get => !babies.NullOrEmpty(); - } - - public int BabyCount - { - get - { - if (babies == null) return 0; - else return babies.Count; - } - } - - public Pawn PeekBaby() - { - if (babies.NullOrEmpty()) return null; - else return babies.First(); + get => !babies.NullOrEmpty(); } public Pawn PopBaby() @@ -172,7 +157,7 @@ namespace RJW_Menstruation // Easier to work out twins that way // From e.g. a vat - if (!(birtherThing is Pawn mother) || !xxx.is_human(mother) || !mother.ShouldCycle()) + if (!(birtherThing is Pawn mother) || !xxx.is_human(mother)) return PawnGenerator.GeneratePawn(request); // No babies found. Could be an unmodified pregnancy @@ -215,7 +200,7 @@ namespace RJW_Menstruation { private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments, bool preventLetter) { - if (birtherThing is Pawn mother && mother.ShouldCycle()) + if (birtherThing is Pawn mother) { HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff().TryGetComp(); if (comp?.HasBaby ?? false) @@ -225,7 +210,7 @@ namespace RJW_Menstruation float birthQuality = PregnancyUtility.GetBirthQualityFor(mother); do { - Pawn baby = comp.PeekBaby(); + Pawn baby = comp.babies[0]; Pawn thisFather = baby.GetFather() ?? father; baby.relations.ClearAllRelations(); // To keep ApplyBirthOutcome from erroring when it tries to set up relations @@ -271,7 +256,7 @@ namespace RJW_Menstruation { private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments) { - if (birtherThing is Pawn mother && mother.ShouldCycle()) + if (birtherThing is Pawn mother) { HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff().TryGetComp(); if (comp?.HasBaby ?? false) @@ -284,7 +269,7 @@ namespace RJW_Menstruation // Though even if it does, that's probably okay. More babies more memories after all do { - Pawn baby = comp.PeekBaby(); + Pawn baby = comp.babies[0]; Pawn thisFather = baby.GetFather() ?? father; baby.relations.ClearAllRelations(); diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index db4bd06..a8e873f 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -118,8 +118,8 @@ namespace RJW_Menstruation } else if (babiescomp?.HasBaby ?? false) { - babydef = babiescomp.PeekBaby().def; - babycount = babiescomp.BabyCount; + babydef = babiescomp.babies.First().def; + babycount = babiescomp.babies.Count; } else { diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs index 6221a81..c572dfc 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs @@ -68,9 +68,6 @@ namespace RJW_Menstruation PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother); PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father); - if (motherKindDef is CreepJoinerFormKindDef) motherKindDef = PawnKindDefOf.Colonist; - if (fatherKindDef is CreepJoinerFormKindDef) fatherKindDef = PawnKindDefOf.Colonist; - PawnKindDef spawn_kind_def = motherKindDef; int flag = 0; diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index dfa13d5..0020d86 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -178,7 +178,7 @@ namespace RJW_Menstruation } } HediffComp_PregeneratedBabies babiescomp = comp.Pregnancy.TryGetComp(); - return babiescomp?.PeekBaby(); + return babiescomp?.babies?.FirstOrDefault(); } public static void DrawBreastIcon(this Pawn pawn, Rect rect)