From c6e4d81a20f026e22e58d07e8225c67246ff5677 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Wed, 28 Feb 2024 19:32:24 -0800 Subject: [PATCH] Don't fertilize from destroyed pawns --- .../RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 7b640a9..5569cdf 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1338,7 +1338,7 @@ namespace RJW_Menstruation protected Pawn Fertilize() { if (cums.NullOrEmpty()) return null; - List eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn))); + List eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && !(cum.pawn?.Destroyed ?? true) && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn))); if (eligibleCum.Count == 0) return null; float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);