[9729] Client not like vendor slot 0 so restore send slots counted from 1

This is must fix not selling first item in list by vendor.
This commit is contained in:
VladimirMangos 2010-04-11 23:22:12 +04:00
parent 0edbefd68f
commit 9304d7509d
2 changed files with 14 additions and 2 deletions

View file

@ -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));

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9728"
#define REVISION_NR "9729"
#endif // __REVISION_NR_H__