Add div/0 check to AfterSimulator just in case something goes weird and it thinks there are no comps

This commit is contained in:
lutepickle 2022-09-09 09:09:33 -07:00
parent 49db91ca4d
commit 0e8c025429

View file

@ -1101,7 +1101,7 @@ namespace RJW_Menstruation
if (EggHealth < 1f) if (EggHealth < 1f)
{ {
if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed); if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
if (sexNeed?.CurLevel < 0.5) sexNeed.CurLevel += 0.01f / Pawn.GetMenstruationComps().Count(); if (sexNeed?.CurLevel < 0.5) sexNeed.CurLevel += 0.01f / Math.Max(1, Pawn.GetMenstruationComps().Count());
} }
} }