Make Implant adding to biotech pregnancy use the casted Hediff_Pregnant

This commit is contained in:
lutepickle 2023-10-29 16:21:27 -07:00
parent 95bdf4ca73
commit a8af20d024

View file

@ -1468,9 +1468,9 @@ namespace RJW_Menstruation
{ {
case Hediff_Pregnant vanillaPreg: // Not going to do the labor ones case Hediff_Pregnant vanillaPreg: // Not going to do the labor ones
if (!Configurations.EnableBiotechTwins || !Configurations.EnableHeteroOvularTwins) goto default; if (!Configurations.EnableBiotechTwins || !Configurations.EnableHeteroOvularTwins) goto default;
if (Configurations.Debug) Log.Message($"Adding to existing Biotech pregnancy {pregnancy.GetUniqueLoadID()}"); if (Configurations.Debug) Log.Message($"Adding to existing Biotech pregnancy {vanillaPreg.GetUniqueLoadID()}");
HediffComp_PregeneratedBabies comp = pregnancy.TryGetComp<HediffComp_PregeneratedBabies>(); HediffComp_PregeneratedBabies comp = vanillaPreg.TryGetComp<HediffComp_PregeneratedBabies>();
if (comp == null) Log.Warning($"Trying to add Biotech egg to {Pawn}'s pregnancy without a pregenerated baby comp: {pregnancy.GetUniqueLoadID()}"); if (comp == null) Log.Warning($"Trying to add Biotech egg to {Pawn}'s pregnancy without a pregenerated baby comp: {vanillaPreg.GetUniqueLoadID()}");
else else
{ {
comp.AddNewBaby(Pawn, egg.fertilizer); comp.AddNewBaby(Pawn, egg.fertilizer);