From 7ebc0e4878bb3a7c3df4bb93975684a8ae4a8680 Mon Sep 17 00:00:00 2001 From: amevarashi Date: Sun, 20 Mar 2022 19:15:55 +0500 Subject: [PATCH] Compatibility with lutepickle's menstruation --- .../ExtensionMethods/PawnExtensions.cs | 21 +------------------ RJWSexperience/RJWSexperience/RJWUtility.cs | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs b/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs index eabef6d..a50a44e 100644 --- a/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs +++ b/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs @@ -4,9 +4,8 @@ using System; using System.Collections.Generic; using System.Linq; using Verse; -using Verse.AI; -namespace RJWSexperience.ExtensionMethods +namespace RJWSexperience { public static class PawnExtensions { @@ -138,24 +137,6 @@ namespace RJWSexperience.ExtensionMethods } } - public static Building_CumBucket FindClosestBucket(this Pawn pawn) - { - List buckets = pawn.Map.listerBuildings.allBuildingsColonist.FindAll(x => x is Building_CumBucket); - Dictionary targets = new Dictionary(); - if (!buckets.NullOrEmpty()) for (int i = 0; i < buckets.Count; i++) - { - if (pawn.CanReach(buckets[i], PathEndMode.ClosestTouch, Danger.None)) - { - targets.Add(buckets[i], pawn.Position.DistanceTo(buckets[i].Position)); - } - } - if (!targets.NullOrEmpty()) - { - return (Building_CumBucket)targets.MinBy(x => x.Value).Key; - } - return null; - } - public static void AteCum(this Pawn pawn, float amount, bool doDrugEffect = false) { pawn.records.AddTo(VariousDefOf.NumofEatenCum, 1); diff --git a/RJWSexperience/RJWSexperience/RJWUtility.cs b/RJWSexperience/RJWSexperience/RJWUtility.cs index 76a4360..b1df5c3 100644 --- a/RJWSexperience/RJWSexperience/RJWUtility.cs +++ b/RJWSexperience/RJWSexperience/RJWUtility.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using rjw; using RimWorld; using Verse; +using Verse.AI; using UnityEngine; using rjw.Modules.Interactions.Objects; using rjw.Modules.Interactions.Helpers; @@ -193,5 +194,25 @@ namespace RJWSexperience pawn.records?.AddTo(recordforpawn, 1); partner.records?.AddTo(recordforpartner, 1); } + + // Moved this method back because of Menstruation + public static Building_CumBucket FindClosestBucket(this Pawn pawn) + { + List buckets = pawn.Map.listerBuildings.allBuildingsColonist.FindAll(x => x is Building_CumBucket); + Dictionary targets = new Dictionary(); + if (!buckets.NullOrEmpty()) for (int i = 0; i < buckets.Count; i++) + { + if (pawn.CanReach(buckets[i], PathEndMode.ClosestTouch, Danger.None)) + { + targets.Add(buckets[i], pawn.Position.DistanceTo(buckets[i].Position)); + } + } + if (!targets.NullOrEmpty()) + { + return (Building_CumBucket)targets.MinBy(x => x.Value).Key; + } + return null; + } + } }