Properly calculate gestation hours

This commit is contained in:
lutepickle 2022-03-08 11:17:44 -08:00
parent dc832dfb0f
commit 84c1d12cff
2 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@ -253,7 +253,12 @@ namespace RJW_Menstruation
public static float GestationHours(this Hediff_BasePregnancy hediff)
{
return (1 / /*hediff?.progress_per_tick ??*/ 1) / 2500f;
if (hediff == null)
{
Log.Error("Tried to get gestation length without a pregnancy.");
return 1f;
}
else return (hediff.p_end_tick - hediff.p_start_tick) / GenDate.TicksPerHour;
}
}