mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10680] Update item buy code for new way vendor item lists work.
This commit is contained in:
parent
0bf8b0aa79
commit
ef8789f780
2 changed files with 6 additions and 3 deletions
|
|
@ -18694,13 +18694,16 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
|||
return false;
|
||||
}
|
||||
|
||||
if (vendorslot >= vItems->GetItemCount())
|
||||
uint32 vCount = vItems ? vItems->GetItemCount() : 0;
|
||||
uint32 tCount = tItems ? tItems->GetItemCount() : 0;
|
||||
|
||||
if (vendorslot >= vCount+tCount)
|
||||
{
|
||||
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
VendorItem const* crItem = vItems->GetItem(vendorslot);
|
||||
VendorItem const* crItem = vendorslot < vCount ? vItems->GetItem(vendorslot) : tItems->GetItem(vendorslot - vCount);
|
||||
if(!crItem || crItem->item != item) // store diff item (cheating)
|
||||
{
|
||||
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue