From b55db79eb5a1c81c14163c26121712c8ed96c112 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Wed, 28 Sep 2022 10:51:54 -0700 Subject: [PATCH] Fallback to display anuses without a comp --- .../RJW_Menstruation/HediffComps/MenstruationUtility.cs | 1 + 1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index 7655dc0..f4980e0 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -274,6 +274,7 @@ namespace RJW_Menstruation public static Texture2D GetAnalIcon(this Pawn pawn, bool drawOrigin = false) { Hediff hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault(h => VariousDefOf.AllAnuses.Contains(h.def)); + if (hediff == null) hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault(h => h.def.defName.Contains("anus")); if (hediff == null) return ContentFinder.Get(("Genitals/Anal00"), true); string icon; diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 71b9f0a..e38765d 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -332,6 +332,7 @@ namespace RJW_Menstruation public static string GetAnusLabel(this Pawn pawn) { Hediff hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault(h => VariousDefOf.AllAnuses.Contains(h.def)); + if (hediff == null) hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault(h => h.def.defName.Contains("anus")); if (hediff != null) return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")"; else return ""; }