Fix CMSG_BUY_ITEM field order: item before slot

TrinityCore's HandleBuyItemOpcode reads vendorGuid → item → slot → count → bagIndex.
The previous fix had accidentally reversed item and slot, so the server received
the vendor slot number as the item ID (a small number like 1-5) and the actual
item ID as the slot, causing every purchase to be silently rejected.
This commit is contained in:
Kelsi 2026-02-17 18:24:53 -08:00
parent 4043e47fd5
commit e73bedd78b

View file

@ -3061,8 +3061,8 @@ network::Packet ListInventoryPacket::build(uint64_t npcGuid) {
network::Packet BuyItemPacket::build(uint64_t vendorGuid, uint32_t itemId, uint32_t slot, uint32_t count) {
network::Packet packet(wireOpcode(Opcode::CMSG_BUY_ITEM));
packet.writeUInt64(vendorGuid);
packet.writeUInt32(slot); // vendor slot (1-based position in vendor list)
packet.writeUInt32(itemId); // item entry
packet.writeUInt32(slot); // vendor slot (1-based position in vendor list)
packet.writeUInt32(count);
packet.writeUInt8(0); // bag slot (0 = find any available bag slot)
return packet;