2731 {
2732 success = false;
2734 {
2736 }
2737 if (
item.headSlot == -1 &&
item.bodySlot == -1 &&
item.legSlot == -1 && !
item.accessory)
2738 {
2740 }
2741 Player player = Main.player[Main.myPlayer];
2742 int num = ((item.vanity && !
item.accessory) ? 10 : 0);
2743 item.favorited = false;
2745 if (
item.headSlot != -1)
2746 {
2747 result = player.armor[num].Clone();
2748 player.armor[num] =
item.Clone();
2749 }
2750 else if (
item.bodySlot != -1)
2751 {
2752 result = player.armor[num + 1].Clone();
2753 player.armor[num + 1] =
item.Clone();
2754 }
2755 else if (
item.legSlot != -1)
2756 {
2757 result = player.armor[num + 2].Clone();
2758 player.armor[num + 2] =
item.Clone();
2759 }
2760 else if (
item.accessory)
2761 {
2762 int num2 = 3;
2763 for (
int i = 3;
i < 10;
i++)
2764 {
2765 if (player.IsItemSlotUnlockedAndUsable(i))
2766 {
2768 if (player.armor[i].type == 0)
2769 {
2771 break;
2772 }
2773 }
2774 }
2775 for (int j = 0; j < player.armor.Length; j++)
2776 {
2777 if (
item.IsTheSameAs(player.armor[j]))
2778 {
2780 }
2781 if (j < 10 && item.wingSlot > 0 && player.armor[j].wingSlot > 0)
2782 {
2784 }
2785 }
2787 {
2789 }
2791 {
2793 }
2796 {
2798 }
2799 for (int k = 0; k < player.armor.Length; k++)
2800 {
2801 if (
item.IsTheSameAs(player.armor[k]))
2802 {
2803 num3 = k;
2804 }
2805 }
2806 result = player.armor[num3].Clone();
2807 player.armor[num3] =
item.Clone();
2809 }
2811 Recipe.FindRecipes();
2812 success = true;
2813 return result;
2814 }
static void PlaySound(int type, Vector2 position, int style=1)
static bool isEquipLocked(int type)
static int accSlotToSwapTo