Refactor AddNewBaby a bit so enzygotic twins get registered for babies without a story. And a smidge more tolerant of null pawn generation

This commit is contained in:
lutepickle 2022-07-27 21:09:46 -07:00
parent dab0913032
commit df1455ece2

View file

@ -424,11 +424,16 @@ namespace RJW_Menstruation
for (int i = 0; i < division; i++) for (int i = 0; i < division; i++)
{ {
Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed); Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed);
if (baby == null) break;
if (division > 1) if (division > 1)
{ {
if (i == 0 && baby.story != null) if (i == 0) firstbaby = baby;
else enzygoticSiblings?.Add(baby, firstbaby);
if (baby.story == null) continue;
if (i == 0)
{ {
firstbaby = baby;
request.FixedGender = baby.gender; request.FixedGender = baby.gender;
firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath"); firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath");
if (firstheadpath == null) if (firstheadpath == null)
@ -444,8 +449,6 @@ namespace RJW_Menstruation
} }
else else
{
if (baby.story != null)
{ {
baby.story.hairDef = firstbaby.story.hairDef; baby.story.hairDef = firstbaby.story.hairDef;
baby.story.hairColor = firstbaby.story.hairColor; baby.story.hairColor = firstbaby.story.hairColor;
@ -457,13 +460,9 @@ namespace RJW_Menstruation
{ {
baby.SetHARCrown(firstHARcrown); baby.SetHARCrown(firstHARcrown);
} }
}
if (firstbaby != null) enzygoticSiblings?.Add(baby, firstbaby);
} }
} }
babies.Add(baby);
if (baby != null) babies.Add(baby);
} }
return true; return true;