2552 {
2553 Player player = Main.player[Main.myPlayer];
2555 {
2556 return;
2557 }
2558 bool success;
2559 if (inv[slot].dye > 0)
2560 {
2561 inv[slot] =
DyeSwap(inv[slot], out success);
2562 if (success)
2563 {
2564 Main.EquipPageSelected = 0;
2566 }
2567 }
2568 else if (Main.projHook[inv[slot].shoot])
2569 {
2570 inv[slot] =
EquipSwap(inv[slot], player.miscEquips, 4, out success);
2571 if (success)
2572 {
2573 Main.EquipPageSelected = 2;
2575 }
2576 }
2577 else if (inv[slot].mountType != -1 && !
MountID.
Sets.
Cart[inv[slot].mountType])
2578 {
2579 inv[slot] =
EquipSwap(inv[slot], player.miscEquips, 3, out success);
2580 if (success)
2581 {
2582 Main.EquipPageSelected = 2;
2584 }
2585 }
2586 else if (inv[slot].mountType != -1 &&
MountID.
Sets.
Cart[inv[slot].mountType])
2587 {
2588 inv[slot] =
EquipSwap(inv[slot], player.miscEquips, 2, out success);
2589 if (success)
2590 {
2591 Main.EquipPageSelected = 2;
2592 }
2593 }
2594 else if (inv[slot].buffType > 0 && Main.lightPet[inv[slot].buffType])
2595 {
2596 inv[slot] =
EquipSwap(inv[slot], player.miscEquips, 1, out success);
2597 if (success)
2598 {
2599 Main.EquipPageSelected = 2;
2600 }
2601 }
2602 else if (inv[slot].buffType > 0 && Main.vanityPet[inv[slot].buffType])
2603 {
2604 inv[slot] =
EquipSwap(inv[slot], player.miscEquips, 0, out success);
2605 if (success)
2606 {
2607 Main.EquipPageSelected = 2;
2608 }
2609 }
2610 else
2611 {
2613 inv[slot] =
ArmorSwap(inv[slot], out success);
2614 if (success)
2615 {
2616 Main.EquipPageSelected = 0;
2618 }
2619 }
2620 Recipe.FindRecipes();
2621 if (context == 3 && Main.netMode == 1)
2622 {
2623 NetMessage.SendData(32, -1, -1, null, player.chest, slot);
2624 }
2625 }
static void HandleOnEquip(Player player, Item item, int context)
static Item DyeSwap(Item item, out bool success)
static bool isEquipLocked(int type)
static Item EquipSwap(Item item, Item[] inv, int slot, out bool success)
static Item ArmorSwap(Item item, out bool success)