-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac7ed2c
commit 1f3ed27
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using RimWorld; | ||
using Verse; | ||
using Verse.AI; | ||
|
||
namespace RWP | ||
{ | ||
public class WorkGiver_RescueDownedColonist : WorkGiver_RescueDowned | ||
{ | ||
public override bool HasJobOnThing(Pawn pawn, Thing t) | ||
{ | ||
Pawn pawn2 = t as Pawn; | ||
if (pawn2 == null || !pawn2.Downed || pawn2.Faction != pawn.Faction || !pawn2.IsColonist || pawn2.InBed() || !pawn.CanReserve(pawn2, 1) || GenAI.EnemyIsNear(pawn2, 40f)) | ||
{ | ||
return false; | ||
} | ||
|
||
Thing thing = base.FindBed(pawn, pawn2); | ||
return thing != null && pawn2.CanReserve(thing, 1); | ||
} | ||
} | ||
} |