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);
            }
        }
Esempio n. 2
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);
 }