public Pawn GenerateBaby(PawnGenerationRequest request, Pawn mother, Pawn father) { Pawn baby = PawnGenerator.GeneratePawn(request); if (baby != null) { if (xxx.is_human(baby)) { List <Trait> traitpool = new List <Trait>(); baby.SetMother(mother); if (mother != father) { if (father.gender != Gender.Female) { baby.SetFather(father); } else { baby.relations.AddDirectRelation(PawnRelationDefOf.Parent, father); } } //if (xxx.has_traits(pawn) && pawn.RaceProps.Humanlike) //{ // foreach (Trait momtrait in pawn.story.traits.allTraits) // { // if (!RJWPregnancySettings.trait_filtering_enabled || !non_genetic_traits.Contains(momtrait.def.defName)) // traitpool.Add(momtrait); // } //} //if (father != null && xxx.has_traits(father) && father.RaceProps.Humanlike) //{ // foreach (Trait poptrait in father.story.traits.allTraits) // { // if (!RJWPregnancySettings.trait_filtering_enabled || !non_genetic_traits.Contains(poptrait.def.defName)) // traitpool.Add(poptrait); // } //} updateTraits(baby, traitpool); } else if (baby.relations != null) { baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, mother); mother.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby); if (mother != father) { baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, father); father.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby); } } } else { Log.Error("Baby not generated. Request: " + request.ToString()); } return(baby); }