コード例 #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
 public static void DropUnusedInventory_PostFix(Pawn pawn)
 {
     PawnUnloadChecker.CheckIfPawnShouldUnloadInventory(pawn);
 }
コード例 #3
0
 public static void IdleJoy_Postfix(Pawn pawn)
 {
     PawnUnloadChecker.CheckIfPawnShouldUnloadInventory(pawn, true);
 }