From 51da88b1201f9acd1e098a28483b4e3201c0cc6e Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 29 Mar 2026 17:30:44 -0700 Subject: [PATCH] fix: SMSG_ITEM_PUSH_RESULT read extra byte causing wrong item count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handler read an extra uint8 (bag) after bagSlot, shifting all subsequent fields by 1 byte. This caused count to straddle the count and countInInventory fields — e.g. count=1 read as 0x03000000 (50M). Also removes cast bar diagnostic overlay and demotes debug logs. --- src/game/inventory_handler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/inventory_handler.cpp b/src/game/inventory_handler.cpp index 7462d0a9..09e4e622 100644 --- a/src/game/inventory_handler.cpp +++ b/src/game/inventory_handler.cpp @@ -194,18 +194,18 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) { // ---- Item push result ---- table[Opcode::SMSG_ITEM_PUSH_RESULT] = [this](network::Packet& packet) { - // guid(8)+received(4)+created(4)+?+?+bag(1)+slot(4)+itemId(4)+...+count(4)+... + // WotLK 3.3.5a: guid(8)+received(4)+created(4)+displayInChat(4)+bagSlot(1) + // +slot(4)+itemId(4)+suffixFactor(4)+randomPropertyId(4)+count(4)+countInInventory(4) if (packet.getSize() - packet.getReadPos() < 45) return; uint64_t guid = packet.readUInt64(); if (guid != owner_.playerGuid) { packet.setReadPos(packet.getSize()); return; } - /*uint32_t received =*/ packet.readUInt32(); - /*uint32_t created =*/ packet.readUInt32(); - /*uint32_t unk1 =*/ packet.readUInt32(); - /*uint8_t unk2 =*/ packet.readUInt8(); - /*uint8_t bag =*/ packet.readUInt8(); - /*uint32_t slot =*/ packet.readUInt32(); + /*uint32_t received =*/ packet.readUInt32(); + /*uint32_t created =*/ packet.readUInt32(); + /*uint32_t displayInChat =*/ packet.readUInt32(); + /*uint8_t bagSlot =*/ packet.readUInt8(); + /*uint32_t slot =*/ packet.readUInt32(); uint32_t itemId = packet.readUInt32(); - /*uint32_t propSeed =*/ packet.readUInt32(); + /*uint32_t suffixFactor =*/ packet.readUInt32(); int32_t randomProp = static_cast(packet.readUInt32()); uint32_t count = packet.readUInt32();