mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Do not use full buckets
This commit is contained in:
parent
eb3eb92ef5
commit
5a68c6ec58
1 changed files with 179 additions and 176 deletions
|
@ -1,11 +1,12 @@
|
||||||
using System.Collections.Generic;
|
using RimWorld;
|
||||||
using rjw;
|
using rjw;
|
||||||
using RimWorld;
|
using rjw.Modules.Interactions.Enums;
|
||||||
|
using rjw.Modules.Interactions.Helpers;
|
||||||
|
using rjw.Modules.Interactions.Objects;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Verse;
|
using Verse;
|
||||||
using Verse.AI;
|
using Verse.AI;
|
||||||
using rjw.Modules.Interactions.Objects;
|
|
||||||
using rjw.Modules.Interactions.Helpers;
|
|
||||||
using rjw.Modules.Interactions.Enums;
|
|
||||||
|
|
||||||
namespace RJWSexperience
|
namespace RJWSexperience
|
||||||
{
|
{
|
||||||
|
@ -178,9 +179,12 @@ namespace RJWSexperience
|
||||||
// Moved this method back because of Menstruation
|
// Moved this method back because of Menstruation
|
||||||
public static Building_CumBucket FindClosestBucket(this Pawn pawn)
|
public static Building_CumBucket FindClosestBucket(this Pawn pawn)
|
||||||
{
|
{
|
||||||
List<Building> buckets = pawn.Map.listerBuildings.allBuildingsColonist.FindAll(x => x is Building_CumBucket);
|
List<Building> buckets = pawn.Map.listerBuildings.allBuildingsColonist.FindAll(x => x is Building_CumBucket bucket && bucket.StoredStackCount < VariousDefOf.GatheredCum.stackLimit);
|
||||||
|
if (buckets.NullOrEmpty())
|
||||||
|
return null;
|
||||||
|
|
||||||
Dictionary<Building, float> targets = new Dictionary<Building, float>();
|
Dictionary<Building, float> targets = new Dictionary<Building, float>();
|
||||||
if (!buckets.NullOrEmpty()) for (int i = 0; i < buckets.Count; i++)
|
for (int i = 0; i < buckets.Count; i++)
|
||||||
{
|
{
|
||||||
if (pawn.CanReach(buckets[i], PathEndMode.ClosestTouch, Danger.None))
|
if (pawn.CanReach(buckets[i], PathEndMode.ClosestTouch, Danger.None))
|
||||||
{
|
{
|
||||||
|
@ -193,6 +197,5 @@ namespace RJWSexperience
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue