mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +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
|
|
@ -15821,8 +15821,11 @@ void GameHandler::buyItem(uint64_t vendorGuid, uint32_t itemId, uint32_t slot, u
|
|||
packet.writeUInt32(itemId); // item entry
|
||||
packet.writeUInt32(slot); // vendor slot index
|
||||
packet.writeUInt32(count);
|
||||
// WotLK/AzerothCore expects a trailing byte here.
|
||||
packet.writeUInt8(0);
|
||||
// WotLK/AzerothCore expects a trailing byte; Classic/TBC do not
|
||||
const bool isWotLk = isActiveExpansion("wotlk");
|
||||
if (isWotLk) {
|
||||
packet.writeUInt8(0);
|
||||
}
|
||||
socket->send(packet);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue