diff --git a/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs b/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs index 2a8e492b..e17d80fa 100644 --- a/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs +++ b/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs @@ -189,16 +189,28 @@ namespace FFXIVClassic_Map_Server.actors.chara { List items = new List(); - for (int i = 0; i < contentList.Length; i++) + for (ushort i = 0; i < contentList.Length; i++) { if (contentList[i] == EMPTY) continue; + + InventoryItem item = GetItem(contentList[i]); + item.linkSlot = i; //We have to set the linkSlot as this is the position in the Referenced IP, not the original IP it's linked from. items.Add(GetItem(contentList[i])); } targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, destinationCapacity, destinationCode)); SendItemPackets(targetPlayer, items); targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + + //Clean Up linkSlots + for (ushort i = 0; i < contentList.Length; i++) + { + if (contentList[i] == EMPTY) + continue; + InventoryItem item = GetItem(contentList[i]); + item.linkSlot = 0xFFFF; + } } #endregion diff --git a/FFXIVClassic Map Server/dataobjects/InventoryItem.cs b/FFXIVClassic Map Server/dataobjects/InventoryItem.cs index a299c016..be2c153a 100644 --- a/FFXIVClassic Map Server/dataobjects/InventoryItem.cs +++ b/FFXIVClassic Map Server/dataobjects/InventoryItem.cs @@ -42,6 +42,7 @@ namespace FFXIVClassic_Map_Server.dataobjects public readonly ItemData itemData; public Character owner = null; public ushort slot = 0xFFFF; + public ushort linkSlot = 0xFFFF; public ushort itemPackage = 0xFFFF; public class ItemModifier @@ -170,7 +171,12 @@ namespace FFXIVClassic_Map_Server.dataobjects binWriter.Write((UInt64)uniqueId); binWriter.Write((Int32)quantity); binWriter.Write((UInt32)itemId); - binWriter.Write((UInt16)slot); + + if (linkSlot == 0xFFFF) + binWriter.Write((UInt16)slot); + else + binWriter.Write((UInt16)linkSlot); + linkSlot = 0xFFFF; binWriter.Write((Byte)dealingVal); binWriter.Write((Byte)dealingMode); diff --git a/data/scripts/commands/TradeExecuteCommand.lua b/data/scripts/commands/TradeExecuteCommand.lua index 849202e1..7dc75c04 100644 --- a/data/scripts/commands/TradeExecuteCommand.lua +++ b/data/scripts/commands/TradeExecuteCommand.lua @@ -29,11 +29,7 @@ function onEventStarted(player, actor, triggerName) callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray"); tradeOffering = player:GetTradeOfferings(); - - if (player.actorId == 0xA6) then - return; - end - + while (true) do widgetOpen, chosenOperation, tradeSlot, itemActor, quantity, itemPackageId, itemSlot = callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processUpdateTradeCommandTrayData");