diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index c8cd72270..dd769607f 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -643,6 +643,12 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data ) recv_data >> vendorguid >> item >> slot >> bagguid >> bagslot >> count; + // client side expected counting from 1, and we send to client vendorslot+1 already + if (slot > 0) + --slot; + else + return; // cheating + uint8 bag = NULL_BAG; // init for case invalid bagGUID // find bag slot by bag guid @@ -679,6 +685,12 @@ void WorldSession::HandleBuyItemOpcode( WorldPacket & recv_data ) recv_data >> vendorguid >> item >> slot >> count >> unk1; + // client side expected counting from 1, and we send to client vendorslot+1 already + if (slot > 0) + --slot; + else + return; // cheating + GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT); } @@ -750,7 +762,7 @@ void WorldSession::SendListInventory(uint64 vendorguid) // reputation discount uint32 price = uint32(floor(pProto->BuyPrice * discountMod)); - data << uint32(vendorslot); + data << uint32(vendorslot +1); // client size expected counting from 1 data << uint32(crItem->item); data << uint32(pProto->DisplayInfoID); data << uint32(crItem->maxcount <= 0 ? 0xFFFFFFFF : pCreature->GetVendorItemCurrentCount(crItem)); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 64e8ed553..1883d7c1d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9728" + #define REVISION_NR "9729" #endif // __REVISION_NR_H__