From b6e1d1ddb738d2ee65eb674c54ddecfd6f048610 Mon Sep 17 00:00:00 2001 From: tinymechanoid333 Date: Tue, 13 Aug 2024 12:26:08 -0500 Subject: [PATCH] Update Patch_BlockedMasturbation.cs Current Blocked Masturbation gene patch does not function, new patch works using the same implementation as RJW Sexperience Ideology --- .../Patches/Patch_BlockedMasturbation.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs b/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs index c888bda..0613554 100644 --- a/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs +++ b/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs @@ -9,18 +9,18 @@ using Verse; namespace RJW_Genes { - [HarmonyPatch(typeof(xxx), "can_masturbate")] - public class Patch_BlockedMasturbation + [HarmonyPatch(typeof(ThinkNode_ChancePerHour_Fappin), "MtbHours")] + public static class Patch_BlockedMasturbation { - public void PostFix(Pawn pawn, ref bool __result) + public static void Postfix(Pawn p, ref float __result) { - if (pawn != null && !pawn.IsAnimal() && pawn.genes != null) + if (p != null && !p.IsAnimal() && p.genes != null) { - __result = __result - && !pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_blocked_masturbation) - && !pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_infectious_blocked_masturbation); + if (p.genes.HasActiveGene(GeneDefOf.rjw_genes_blocked_masturbation) || p.genes.HasActiveGene(GeneDefOf.rjw_genes_infectious_blocked_masturbation)) + { + __result = -2f; + } } } - } }