mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[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:
parent
0edbefd68f
commit
9304d7509d
2 changed files with 14 additions and 2 deletions
|
|
@ -643,6 +643,12 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
recv_data >> vendorguid >> item >> slot >> bagguid >> bagslot >> count;
|
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
|
uint8 bag = NULL_BAG; // init for case invalid bagGUID
|
||||||
|
|
||||||
// find bag slot by bag guid
|
// find bag slot by bag guid
|
||||||
|
|
@ -679,6 +685,12 @@ void WorldSession::HandleBuyItemOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
recv_data >> vendorguid >> item >> slot >> count >> unk1;
|
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);
|
GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -750,7 +762,7 @@ void WorldSession::SendListInventory(uint64 vendorguid)
|
||||||
// reputation discount
|
// reputation discount
|
||||||
uint32 price = uint32(floor(pProto->BuyPrice * discountMod));
|
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(crItem->item);
|
||||||
data << uint32(pProto->DisplayInfoID);
|
data << uint32(pProto->DisplayInfoID);
|
||||||
data << uint32(crItem->maxcount <= 0 ? 0xFFFFFFFF : pCreature->GetVendorItemCurrentCount(crItem));
|
data << uint32(crItem->maxcount <= 0 ? 0xFFFFFFFF : pCreature->GetVendorItemCurrentCount(crItem));
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9728"
|
#define REVISION_NR "9729"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue