From 8888f76708ebc5defa5dc2bdb7b6f5108d8b9fc7 Mon Sep 17 00:00:00 2001 From: Reisen Usagi Date: Tue, 22 Mar 2022 20:15:38 -0300 Subject: [PATCH 1/2] Fix NRE when jobdriver partner is null --- 1.3/Source/Comps/CompBodyAnimator.cs | 29 +++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/1.3/Source/Comps/CompBodyAnimator.cs b/1.3/Source/Comps/CompBodyAnimator.cs index 9f5f95c..0d9c966 100644 --- a/1.3/Source/Comps/CompBodyAnimator.cs +++ b/1.3/Source/Comps/CompBodyAnimator.cs @@ -501,14 +501,29 @@ namespace Rimworld_Animations { public bool LoopNeverending() { - if(pawn?.jobs?.curDriver != null && - (pawn.jobs.curDriver is JobDriver_Sex) && (pawn.jobs.curDriver as JobDriver_Sex).neverendingsex || - (pawn.jobs.curDriver is JobDriver_SexBaseReciever) && (pawn.jobs.curDriver as JobDriver_Sex).Partner?.jobs?.curDriver != null && ((pawn.jobs.curDriver as JobDriver_Sex).Partner.jobs.curDriver as JobDriver_Sex).neverendingsex) - { - return true; - } + return IsNeverEndingSex(pawn) || IsNeverEndingSexPartner(pawn); + } - return false; + public static bool IsNeverEndingSex(Pawn pawn) + { + bool hasDriver = pawn?.jobs?.curDriver != null; + if (!hasDriver) + return false; + + return (pawn.jobs.curDriver is JobDriver_Sex jds) && jds.neverendingsex; + } + + public static bool IsNeverEndingSexPartner(Pawn pawn) + { + bool hasDriver = pawn?.jobs?.curDriver != null; + if (!hasDriver) + return false; + + var partner = (pawn.jobs.curDriver is JobDriver_SexBaseReciever jds) ? jds.Partner : null; + if (partner == null) + return false; + + return IsNeverEndingSex(partner); } public void ResetOnLoop() From 9962d2b33e52e8cb6232748f89f26fc14bc7f1cd Mon Sep 17 00:00:00 2001 From: c0ffee Date: Thu, 2 Feb 2023 16:34:10 -0800 Subject: [PATCH 2/2] rebuild for new HAR patch --- 1.4/Assemblies/Rimworld-Animations.dll | Bin 58368 -> 58368 bytes .../Assemblies/Patch_HumanoidAlienRaces.dll | Bin 9216 -> 9216 bytes .../Assemblies/Patch_SexToysMasturbation.dll | Bin 7168 -> 7168 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/1.4/Assemblies/Rimworld-Animations.dll b/1.4/Assemblies/Rimworld-Animations.dll index 1cd8c2d83038b96baf1d383770ed9263a9d721b5..6aacdcf5623a62cd6fdd5aa1d5189aaa7caba5c1 100644 GIT binary patch delta 231 zcmZoT!Q60yc|r$E(Dr@*H};fuu{=^x_TJ3a?PMjuTf~0vYx#QTiBbR71h4ck+#GRK zke}1U&_d79(#Y6!a^h9B$uq9Fp^9wgy&A)aDl~b Fs0#0I6u$rf delta 47 zcmV+~0MP${NPtL?hy+DGv9qy^Mh*nQAlI0))(&zC5b=z9*xJG3OpAeYOyP+nn6p?J Fs0sk}75e}H diff --git a/Patch_SexToysMasturbation/1.4/Assemblies/Patch_SexToysMasturbation.dll b/Patch_SexToysMasturbation/1.4/Assemblies/Patch_SexToysMasturbation.dll index 99b739540e419117e85e864b99851a199641f219..5543661d023636d75b2562a85ee99710709b41e9 100644 GIT binary patch delta 47 zcmZp$Xt0>j!4l?Z{A**68z;*n1!eEe*EkQc3owP{MHc31x-M&r)mxx=;N#{Mf)QK* Ds|gYx delta 47 zcmV+~0MP${IDj~ihy=~VNs6(IMhOJLAlI0))(OG~5O^FZnZc+kM5e2+MhRy|p0lVC FSPJOA6VU(w