Skip to content

Commit

Permalink
Source maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
DingoDjango authored Nov 4, 2016
1 parent ac7ed2c commit 1f3ed27
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Source/WorkGiver_RescueDownedColonist.cs
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);
}
}
}

0 comments on commit 1f3ed27

Please sign in to comment.