コード例 #1
0
 private static void NotifyAdded(ThingOwner <Thing> __instance, Thing item)
 {
     if (ThingOwnerUtility.ShouldAutoExtinguishInnerThings(__instance.Owner) && item.HasAttachment(ThingDefOf.Fire))
     {
         item.GetAttachment(ThingDefOf.Fire).Destroy(DestroyMode.Vanish);
     }
     if (ThingOwnerUtility.ShouldRemoveDesignationsOnAddedThings(__instance.Owner))
     {
         List <Map> maps = Find.Maps;
         for (int index = 0; index < maps.Count; ++index)
         {
             maps[index].designationManager.RemoveAllDesignationsOn(item, false);
         }
     }
     if (__instance.Owner is CompTransporter owner2)
     {
         owner2.Notify_ThingAdded(item);
     }
     if (__instance.Owner is Caravan owner3)
     {
         owner3.Notify_PawnAdded((Pawn)item);
     }
     if (__instance.Owner is Pawn_ApparelTracker owner4)
     {
         owner4.Notify_ApparelAdded((Apparel)item);
     }
     if (__instance.Owner is Pawn_EquipmentTracker owner5)
     {
         owner5.Notify_EquipmentAdded((ThingWithComps)item);
     }
     NotifyColonistBarIfColonistCorpse(item);
 }