mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[9716] Allow to vendor have same items in list with different extanded price.
This commit is contained in:
parent
da253087cb
commit
25c2a76b63
12 changed files with 56 additions and 33 deletions
|
|
@ -58,29 +58,24 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
|
|||
|
||||
bool VendorItemData::RemoveItem( uint32 item_id )
|
||||
{
|
||||
bool found = false;
|
||||
for(VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||
{
|
||||
// can have many examples
|
||||
if((*i)->item == item_id)
|
||||
{
|
||||
m_items.erase(i);
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
size_t VendorItemData::FindItemSlot(uint32 item_id) const
|
||||
{
|
||||
for(size_t i = 0; i < m_items.size(); ++i )
|
||||
if(m_items[i]->item == item_id)
|
||||
return i;
|
||||
return m_items.size();
|
||||
}
|
||||
|
||||
VendorItem const* VendorItemData::FindItem(uint32 item_id) const
|
||||
VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extendedCost) const
|
||||
{
|
||||
for(VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||
if((*i)->item == item_id)
|
||||
if((*i)->item == item_id && (*i)->ExtendedCost == extendedCost)
|
||||
return *i;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue