Add some debug logging around the pregnancy to labor transition

This commit is contained in:
lutepickle 2023-03-01 09:55:54 -08:00
parent ca895ef296
commit b28beb8eaa
2 changed files with 5 additions and 0 deletions

Binary file not shown.

View file

@ -26,8 +26,10 @@ namespace RJW_Menstruation
public static void Postfix(Hediff_Pregnant __instance)
{
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s labor starting, menstruation comp is {comp}");
if (comp == null) return;
comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLabor);
if (Configurations.Debug) Log.Message($"New pregnancy Hediff is {comp.Pregnancy}");
}
}
@ -37,8 +39,10 @@ namespace RJW_Menstruation
public static void PostFix(Hediff_Labor __instance)
{
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s initial labor ending, menstruation comp is {comp}");
if (comp == null) return;
comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLaborPushing);
if (Configurations.Debug) Log.Message($"New pregnancy Hediff is {comp.Pregnancy}");
}
}
@ -48,6 +52,7 @@ namespace RJW_Menstruation
public static void PostFix(Hediff_LaborPushing __instance)
{
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s labor pushing ending, menstruation comp is {comp}");
if (comp == null) return;
comp.Pregnancy = null;
}