From e73bedd78bd9c542820b8f25953936487d8c9bd9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Feb 2026 18:24:53 -0800 Subject: [PATCH] Fix CMSG_BUY_ITEM field order: item before slot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/game/world_packets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index fefccb47..09e3e54f 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -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;