mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +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;
|
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);
|
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||||
return false;
|
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)
|
if(!crItem || crItem->item != item) // store diff item (cheating)
|
||||||
{
|
{
|
||||||
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10679"
|
#define REVISION_NR "10680"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue