Esempio n. 1
0
 /// <summary>
 /// Find Vehicle (Not pack animal) with usable free space for caravan packing
 /// </summary>
 /// <param name="pawn"></param>
 /// <param name="__result"></param>
 public static bool UsableVehicleWithMostFreeSpace(Pawn pawn, ref Pawn __result)
 {
     if (CaravanHelper.IsFormingCaravanShipHelper(pawn) || pawn.Map.mapPawns.SpawnedPawnsInFaction(pawn.Faction).HasVehicle())
     {
         __result = CaravanHelper.UsableVehicleWithTheMostFreeSpace(pawn);
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
 protected virtual Toil FindNearestVehicle()
 {
     return(new Toil
     {
         initAction = delegate()
         {
             Pawn pawn = CaravanHelper.UsableVehicleWithTheMostFreeSpace(this.pawn);
             if (pawn is null)
             {
                 this.pawn.jobs.EndCurrentJob(JobCondition.Incompletable, true);
             }
             else
             {
                 this.job.SetTarget(TargetIndex.B, pawn);
             }
         }
     });