Put a warning in the log when loading a pregnancy with mother == father

This commit is contained in:
lutepickle 2024-07-31 07:22:20 -07:00
parent 4be4d881d5
commit f70c2ad585

View file

@ -639,8 +639,12 @@ namespace RJW_Menstruation
if (Scribe.mode == LoadSaveMode.PostLoadInit)
{
Initialize();
if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father) // Fix mother == father issue
// Biotech labor errors if the mother is also the father, so don't let that happen
if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father && vanillaPreg.Mother != null)
{
Log.Warning($"Pregnancy of {Pawn} has same mother and father, setting father to null");
vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet);
}
}
}