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++)
{
Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed);
if (baby == null) break;
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;
firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath");
if (firstheadpath == null)
@ -445,25 +450,19 @@ namespace RJW_Menstruation
}
else
{
if (baby.story != null)
baby.story.hairDef = firstbaby.story.hairDef;
baby.story.hairColor = firstbaby.story.hairColor;
baby.story.bodyType = firstbaby.story.bodyType;
baby.story.crownType = firstbaby.story.crownType;
baby.story.SetMemberValue("headGraphicPath", firstheadpath);
if (Configurations.HARActivated && baby.IsHAR())
{
baby.story.hairDef = firstbaby.story.hairDef;
baby.story.hairColor = firstbaby.story.hairColor;
baby.story.bodyType = firstbaby.story.bodyType;
baby.story.crownType = firstbaby.story.crownType;
baby.story.SetMemberValue("headGraphicPath", firstheadpath);
if (Configurations.HARActivated && baby.IsHAR())
{
baby.SetHARCrown(firstHARcrown);
}
baby.SetHARCrown(firstHARcrown);
}
if (firstbaby != null) enzygoticSiblings?.Add(baby, firstbaby);
}
}
if (baby != null) babies.Add(baby);
babies.Add(baby);
}
return true;