942 {
943 Player player = Main.player[Main.myPlayer];
944 Item[] inventory = player.inventory;
946 if (player.chest > -1)
947 {
948 item = Main.chest[player.chest].item;
949 }
950 else if (player.chest == -2)
951 {
952 item = player.bank.item;
953 }
954 else if (player.chest == -3)
955 {
956 item = player.bank2.item;
957 }
958 else if (player.chest == -4)
959 {
960 item = player.bank3.item;
961 }
962 else if (player.chest == -5)
963 {
964 item = player.bank4.item;
965 }
969 for (int num = 57; num >= 0; num--)
970 {
971 if ((
num < 50 || num >= 54) && (inventory[num].type < 71 || inventory[num].type > 74))
972 {
973 if (inventory[num].stack > 0 && inventory[num].maxStack > 1 && inventory[num].prefix == 0)
974 {
976 if (inventory[num].stack < inventory[num].maxStack)
977 {
979 }
980 }
981 else if (inventory[num].stack == 0 || inventory[num].netID == 0 || inventory[num].type == 0)
982 {
984 }
985 }
986 }
987 bool flag = false;
988 for (
int i = 0;
i <
item.Length;
i++)
989 {
990 if (item[i].stack < 1 || item[i].prefix != 0 || !
hashSet.
Contains(item[i].netID))
991 {
992 continue;
993 }
995 for (
int j = 0;
j <
list.Count;
j++)
996 {
998 int context = 0;
1000 {
1001 context = 2;
1002 }
1003 if (inventory[
num2].netID != item[i].netID || ItemSlot.PickItemMovementAction(inventory, context,
num2, item[i]) == -1)
1004 {
1005 continue;
1006 }
1008 if (inventory[
num2].maxStack - inventory[
num2].stack <
num3)
1009 {
1010 num3 = inventory[
num2].maxStack - inventory[
num2].stack;
1011 }
1014 flag = true;
1015 if (inventory[
num2].stack == inventory[
num2].maxStack)
1016 {
1017 if (Main.netMode == 1 && Main.player[Main.myPlayer].chest > -1)
1018 {
1019 NetMessage.SendData(32, -1, -1, null, Main.player[Main.myPlayer].chest, i);
1020 }
1023 }
1024 if (item[i].stack == 0)
1025 {
1028 if (Main.netMode == 1 && Main.player[Main.myPlayer].chest > -1)
1029 {
1030 NetMessage.SendData(32, -1, -1, null, Main.player[Main.myPlayer].chest, i);
1031 }
1032 break;
1033 }
1034 }
1036 {
1037 continue;
1038 }
1040 {
1043 {
1045 }
1046 if (ItemSlot.PickItemMovementAction(inventory,
context2,
list2[
k], item[i]) != -1)
1047 {
1049 if (Main.netMode == 1 && Main.player[Main.myPlayer].chest > -1)
1050 {
1051 NetMessage.SendData(32, -1, -1, null, Main.player[Main.myPlayer].chest, i);
1052 }
1055 flag = true;
1056 break;
1057 }
1058 }
1059 }
1060 if (flag)
1061 {
1063 }
1064 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static void PlaySound(int type, Vector2 position, int style=1)