Ejemplo n.º 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);
            //}
        }
Ejemplo n.º 2
0
 public static void DropUnusedInventory_PostFix(Pawn pawn)
 {
     PawnUnloadChecker.CheckIfPawnShouldUnloadInventory(pawn);
 }
Ejemplo n.º 3
0
 public static void IdleJoy_Postfix(Pawn pawn)
 {
     PawnUnloadChecker.CheckIfPawnShouldUnloadInventory(pawn, true);
 }