public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t == null)
            {
                return(false);
            }

            Pawn pawn2 = t as Pawn;

            if (pawn2 == null || pawn2 == pawn)
            {
                return(false);
            }
            if (!pawn.CanReserveAndReach(t, PathEndMode.ClosestTouch, Danger.Deadly, 1))
            {
                return(false);
            }

            CompTransporterPawn transporter = t.TryGetComp <CompTransporterPawn>();

            if (transporter == null)
            {
                return(false);
            }
            return(LoadTransportersPawnJobUtility.HasJobOnTransporter(pawn, transporter));
        }
        protected override Job TryGiveJob(Pawn pawn)
        {
            Utility.DebugReport("JobGiver_LoadTransportersPawn Called");
            var transportersGroup = pawn.mindState.duty.transportersGroup;

            LoadTransportersPawnJobUtility.GetTransportersInGroup(transportersGroup, pawn.Map, tmpTransporters);
            foreach (var transporter in tmpTransporters)
            {
                if (LoadTransportersPawnJobUtility.HasJobOnTransporter(pawn, transporter))
                {
                    return(LoadTransportersPawnJobUtility.JobOnTransporter(pawn, transporter));
                }
            }

            return(null);
        }
Пример #3
0
        protected override Job TryGiveJob(Pawn pawn)
        {
            Cthulhu.Utility.DebugReport("JobGiver_LoadTransportersPawn Called");
            int transportersGroup = pawn.mindState.duty.transportersGroup;

            LoadTransportersPawnJobUtility.GetTransportersInGroup(transportersGroup, pawn.Map, JobGiver_LoadTransportersPawn.tmpTransporters);
            for (int i = 0; i < JobGiver_LoadTransportersPawn.tmpTransporters.Count; i++)
            {
                CompTransporterPawn transporter = JobGiver_LoadTransportersPawn.tmpTransporters[i];
                if (LoadTransportersPawnJobUtility.HasJobOnTransporter(pawn, transporter))
                {
                    return(LoadTransportersPawnJobUtility.JobOnTransporter(pawn, transporter));
                }
            }
            return(null);
        }