rjw-genes/1.6/Source/Genes/Patches/Patch_Asexual_CanRape.cs
Telanda-DDS dde1c98b18 - Incremented version to 2.5.1
- Removed DDS Files
- Added Initial Support for Rimworld 1.6
- Added Additional mod requirement to PatchBSShared.xml to prevent premature loading.
- Refactored Cumpilation integration to make it optional rather then a Required Mod.
- Disabled succubus tail interactions pending rewrite for RJW's new interactions system.
- Disabled Quirks pending rewrite RJW separating them into their own mod.
2025-07-17 21:07:51 +10:00

28 lines
831 B
C#

using HarmonyLib;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace RJW_Genes.Genes.Patches
{
/// <summary>
/// This Patch hooks after "can_rape" and changes it to false for pawns that have no sex_need (are a-sexual).
/// This helps with #100, and is more of a non-intrusive improvement over the base game.
/// </summary>
[HarmonyPatch(typeof(xxx), nameof(xxx.can_rape))]
public class Patch_Asexual_CanRape
{
public static bool PostFix(Pawn pawn, ref bool __result)
{
if (pawn != null && pawn.genes != null && pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_no_sex_need))
{
__result = false;
}
return __result;
}
}
}