rjw-genes/1.6/Source/Genes/Patches/Patch_sexualize_pawn.cs
Telanda-DDS 11226249b3 ###Fixes###
- Fixed "Big and Small - Heaven and Hell" XML patch being applied incorrectly, again.
- Fixed issue that was causing Extra genitals,Anus,breasts being added to pawns when a gene was applied.
- Removed some code duplication in the Gender specific Genes, I cannot see any situations where this code was required, but but there are some notes in other genes relating to character editor, I'm leaving other genes As they are for now, and will wait to see if it breaks some strange edge case I didn't test for.
2025-07-19 16:49:52 +10:00

35 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using rjw;
using Verse;
namespace RJW_Genes
{
internal static class Patch_sexualize_pawn
{
/// <summary>
/// Harmony Patch for RJW.Sexualizer.sexualize_pawn, Simply checks to see if the pawn already has genitals and skips the function entirely if the pawn has already got genitals of some sort,
/// may cause issues if pawn has all the 'no genitals' Genes?
/// </summary>
internal static bool PreFix(Pawn pawn ) {
//if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
if (!(Genital_Helper.has_genitals(pawn) || Genital_Helper.has_anus(pawn) || Genital_Helper.has_breasts(pawn)))
{
return true;
}
//DEBUG Info.
string genitalList = "";
foreach (Hediff genital in pawn.GetGenitalsList())
{
genitalList += genital.Label + ",";
}
ModLog.Debug($"RJW_Genes is currently pre-patching sexualize_pawn, and blocks it running if it detects the pawn already has genitals.");
ModLog.Debug($"Pawn Already has some genitals, {genitalList}");
return false;
}
}
}