The GetBodyFactor patch doesn't need to test for __result <= 0, as that isn't possible. While I'm at it, a slight refactor in CountSatisfiedQuirks.

This commit is contained in:
lutepickle 2022-04-28 09:18:50 -07:00
parent fda3442d9d
commit 00ad2e94d4
2 changed files with 2 additions and 4 deletions

Binary file not shown.

View file

@ -136,12 +136,12 @@ namespace RJW_Menstruation
{
// Awkward, but it'll have to do
Pawn pawn = props.pawn;
if (!pawn.Has(Quirk.ImpregnationFetish) || !props.hasPartner()) return;
if (__result == 0 || !pawn.Has(Quirk.ImpregnationFetish) || !props.hasPartner()) return;
// Check if the existing code would have added the count
Pawn partner = props.partner;
if (!(PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) || PregnancyHelper.CanImpregnate(partner, pawn, props.sexType))) return;
__result = Mathf.Max(0, __result - 1); // __result shouldn't go negative, but it's better to be safe
else __result--;
if (
(PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) && (partner.GetMenstruationComp()?.IsDangerDay ?? true))
@ -168,8 +168,6 @@ namespace RJW_Menstruation
}
public static void Postfix(ref float __result, Pawn fucker, Pawn fucked)
{
if (__result <= 0) return;
if (HediffComp_Menstruation.IsInEstrus(fucker, true) && PregnancyHelper.CanImpregnate(fucked, fucker))
{
__result *= (1f + GetNetFertility(fucker, fucked) / 4);