mirror of
https://gitgud.io/c0ffeeeeeeee/rjw-events.git
synced 2024-08-14 23:57:42 +00:00
Added check to make sure pawn is in gathering area before joining
This commit is contained in:
parent
49fb421099
commit
5892f561fb
2 changed files with 14 additions and 1 deletions
Binary file not shown.
|
@ -52,7 +52,20 @@ namespace RJW_Events
|
|||
return null;
|
||||
}
|
||||
|
||||
List<Pawn> targets = LordUtility.GetLord(pawn).ownedPawns;
|
||||
List<Pawn> targets = LordUtility.GetLord(pawn).ownedPawns.Where((Pawn p) => {
|
||||
|
||||
if(p?.mindState?.duty == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IntVec3 cell = p.mindState.duty.focus.Cell;
|
||||
if (GatheringsUtility.InGatheringArea(p.Position, cell, p.Map)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).ToList();
|
||||
|
||||
|
||||
if (!BestPawnForOrgyExists(pawn, targets, out Pawn pawn2))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue