示例#1
0
        private static void JobDriver_HaulToCell_PostFix(JobDriver_HaulToCell __instance)
        {
            CompHauledToInventory takenToInventory = __instance.pawn.TryGetComp <CompHauledToInventory>();

            if (takenToInventory == null)
            {
                return;
            }

            HashSet <Thing> carriedThing = takenToInventory.GetHashSet();

            if (__instance.job.haulMode == HaulMode.ToCellStorage &&
                __instance.pawn.Faction == Faction.OfPlayer &&
                __instance.pawn.RaceProps.Humanlike &&
                __instance.pawn.carryTracker.CarriedThing is Corpse == false &&
                carriedThing != null &&
                carriedThing.Count != 0)   //deliberate hauling job. Should unload.
            {
                PawnUnloadChecker.CheckIfPawnShouldUnloadInventory(__instance.pawn, true);
            }
            //else //we could politely ask
            //{
            //    PawnUnloadChecker.CheckIfPawnShouldUnloadInventory(__instance.pawn);
            //}
        }
示例#2
0
 static void CustomJobReport(JobDriver_HaulToCell __instance, ref string __result)
 {
     if (!haulTrackers.TryGetValue(__instance.pawn, out var haulTracker))
     {
         return;
     }
     __result = haulTracker.GetJobReportPrefix() + __result;
 }
示例#3
0
 static void GetJooReportString(JobDriver_HaulToCell __instance, ref string __result)
 {
     if (!Hauling.pawnHaulToCell.ContainsKey(__instance.pawn))
     {
         return;
     }
     __result = $"Opportunistically {__result}";
 }