mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
fix: conditionally include trailing byte in CMSG_BUY_ITEM for Classic/TBC
CMSG_BUY_ITEM format differs by expansion: - WotLK 3.3.5a / AzerothCore: includes trailing uint8(0) after count field (17 bytes) - Classic 1.12 / TBC 2.4.3: no trailing byte (16 bytes) The static BuyItemPacket::build() helper always adds the byte (AzerothCore compat). GameHandler::buyItem() now gates the byte based on active expansion, allowing Classic/TBC servers to receive correctly-sized packets.
This commit is contained in:
parent
ed48a3c425
commit
dd67c88175
2 changed files with 8 additions and 3 deletions
|
|
@ -3828,7 +3828,9 @@ network::Packet BuyItemPacket::build(uint64_t vendorGuid, uint32_t itemId, uint3
|
|||
packet.writeUInt32(itemId); // item entry
|
||||
packet.writeUInt32(slot); // vendor slot index from SMSG_LIST_INVENTORY
|
||||
packet.writeUInt32(count);
|
||||
// WotLK/AzerothCore expects a trailing byte on CMSG_BUY_ITEM.
|
||||
// Note: WotLK/AzerothCore expects a trailing byte; Classic/TBC do not.
|
||||
// This static helper always adds it (appropriate for CMaNGOS/AzerothCore).
|
||||
// For Classic/TBC, use the GameHandler::buyItem() path which checks expansion.
|
||||
packet.writeUInt8(0);
|
||||
return packet;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue