コード例 #1
0
        // RimWorld.LoadTransportersJobUtility
        public static bool HasJobOnTransporter(Pawn pawn, CompTransporterPawn transporter)
        {
            bool result = !transporter.parent.IsForbidden(pawn) && transporter.AnythingLeftToLoad &&
                          pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation) &&
                          pawn.CanReserveAndReach(transporter.parent, PathEndMode.Touch, pawn.NormalMaxDanger(), 1) &&
                          LoadTransportersPawnJobUtility.FindThingToLoad(pawn, transporter) != null;

            Cthulhu.Utility.DebugReport(pawn.Label + " HasJobOnTransporter: " + result.ToString());
            return(result);
        }
コード例 #2
0
        public static Job JobOnTransporter(Pawn p, CompTransporterPawn transporter)
        {
            Cthulhu.Utility.DebugReport("JobOnTransporter Called");
            Thing thing = LoadTransportersPawnJobUtility.FindThingToLoad(p, transporter);

            return(new Job(JobDefOf.HaulToContainer, thing, transporter.parent)
            {
                count = Mathf.Min(
                    TransferableUtility.TransferableMatching <TransferableOneWay>(thing, transporter.leftToLoad,
                                                                                  TransferAsOneMode.PodsOrCaravanPacking).CountToTransfer, thing.stackCount),
                ignoreForbidden = true
            });
        }