static bool doStripCorpse(RecipeDef def, Thing thing)
        {
            if (!def.autoStripCorpses)
            {
                IStrippable strippable = thing as IStrippable;
                Corpse      corpse     = thing as Corpse;
                Pawn        pawn;
                if (corpse == null)
                {
                    pawn = thing as Pawn;
                }
                else
                {
                    pawn = corpse.InnerPawn;
                }

                StripFlags val = StripFlags.None;
                if (pawn != null)
                {
                    val = Settings.getStripFlags();
                    if (!CompStripChecker.MarkAll(pawn, true, val))
                    {
                        val = StripFlags.None;
                    }
                }

                return(strippable != null && thing.MapHeld != null && (val != StripFlags.None || thing.MapHeld.designationManager.DesignationOn(thing, DesignationDefOf.Strip) != null));
            }
            else
            {
                return(true);
            }
        }
Пример #2
0
        static void Postfix(Thing thing, IntVec3 dropCell, Map map, ThingPlaceMode mode, Thing resultingThing, Action <Thing, int> placedAction, Predicate <IntVec3> nearPlaceValidator)
        {
            CompStripChecker UChecker = resultingThing.TryGetComp <CompStripChecker>();

            if (UChecker != null)
            {
                UChecker.ShouldStrip = false;
            }
        }
Пример #3
0
 static void Postfix(ThingWithComps __instance)
 {
     if (Scribe.mode == LoadSaveMode.LoadingVars)
     {
         bool a = false;
         Scribe_Values.Look(ref a, "NonUnoPinataShouldStrip", defaultValue: false);
         if (a)
         {
             CompStripChecker.GetChecker(__instance, a);
         }
     }
 }
Пример #4
0
 static bool Prefix(Designation __instance)
 {
     // designation gets removed before stripping is happened, so it doesn't work as intended
     if (__instance.def == DesignationDefOf.Strip && __instance.target.HasThing)
     {
         Corpse c = __instance.target.Thing as Corpse;
         if (c != null)
         {
             if (c.InnerPawn != null)
             {
                 CompStripChecker.MarkAll(c.InnerPawn, false);
             }
         }
         else
         {
             CompStripChecker.MarkAll((Pawn)__instance.target.Thing, false);
         }
         return(false);
     }
     return(true);
 }
 static bool Prefix(Pawn __instance)
 {
     return(__instance.GetCaravan() != null || !CompStripChecker.TryDropMarked(__instance));
 }