mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
HediffWithParents.PreRemoved doesn't like it if mother equals father, so add some checks for that
This commit is contained in:
parent
c81f94fa04
commit
d4f8312cee
4 changed files with 5 additions and 2 deletions
Binary file not shown.
|
@ -1429,7 +1429,9 @@ namespace RJW_Menstruation
|
||||||
pregnancy = HediffMaker.MakeHediff(HediffDefOf.PregnantHuman, Pawn);
|
pregnancy = HediffMaker.MakeHediff(HediffDefOf.PregnantHuman, Pawn);
|
||||||
if (Configurations.EnableBiotechTwins)
|
if (Configurations.EnableBiotechTwins)
|
||||||
pregnancy.TryGetComp<HediffComp_PregeneratedBabies>().AddNewBaby(Pawn, egg.fertilizer);
|
pregnancy.TryGetComp<HediffComp_PregeneratedBabies>().AddNewBaby(Pawn, egg.fertilizer);
|
||||||
((Hediff_Pregnant)pregnancy).SetParents(Pawn, egg.fertilizer, PregnancyUtility.GetInheritedGeneSet(egg.fertilizer, Pawn));
|
Pawn father = egg.fertilizer;
|
||||||
|
if (Pawn == father) father = null;
|
||||||
|
((Hediff_Pregnant)pregnancy).SetParents(Pawn, father, PregnancyUtility.GetInheritedGeneSet(father, Pawn));
|
||||||
Pawn.health.AddHediff(pregnancy);
|
Pawn.health.AddHediff(pregnancy);
|
||||||
pregnant = true;
|
pregnant = true;
|
||||||
deadeggs.Add(egg);
|
deadeggs.Add(egg);
|
||||||
|
|
|
@ -234,6 +234,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
Pawn baby = comp.PeekBaby();
|
Pawn baby = comp.PeekBaby();
|
||||||
Pawn thisFather = baby.GetFather() ?? father;
|
Pawn thisFather = baby.GetFather() ?? father;
|
||||||
|
if (thisFather == geneticMother || thisFather == mother) thisFather = null;
|
||||||
baby.relations.ClearAllRelations(); // To keep ApplyBirthOutcome from erroring when it tries to set up relations
|
baby.relations.ClearAllRelations(); // To keep ApplyBirthOutcome from erroring when it tries to set up relations
|
||||||
|
|
||||||
PregnancyUtility.ApplyBirthOutcome_NewTemp(thisOutcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments, preventLetter);
|
PregnancyUtility.ApplyBirthOutcome_NewTemp(thisOutcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments, preventLetter);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<identifier>RJW Menstruation</identifier>
|
<identifier>RJW Menstruation</identifier>
|
||||||
<version>1.5.0.1</version>
|
<version>1.5.0.2</version>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<incompatibleWith />
|
<incompatibleWith />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue