Let CalculatedImpactChance return early to avoid unnecessarily hitting OvulationChance

This commit is contained in:
lutepickle 2024-02-12 20:54:31 -08:00
parent 50310988ca
commit 836d3d69c8
1 changed files with 1 additions and 0 deletions

View File

@ -322,6 +322,7 @@ namespace RJW_Menstruation
// Implant factor will be based solely on pawn age, plus any rollover from ovulation chance
float factor = 1.0f;
StatDefOf.Fertility.GetStatPart<StatPart_FertilityByGenderAge>()?.TransformValue(StatRequest.For(Pawn), ref factor);
if (factor <= 0.0f) return 0.0f;
if (OvulationChance > 1.0f) factor *= OvulationChance;
return Props.baseImplantationChanceFactor * FertilityModifier * factor;
}