* Implement item limit category (based on changes by VladimirMangos)

* Additional check for HandleAutoBankItemOpcode (thanks to VladimitMangos)
* Properly show empty vendor list for empty item list (author: a1ien)
* More stricted checks for store operations (thanks to VladimirMangos)
* Prevent autostoring of not empty bags (thanks to L1ghtGu4rd)

Changes need testing. Please post bugs on our tracker.

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-05 22:08:07 +06:00
parent a042b972ed
commit 885fc368fd
20 changed files with 198 additions and 179 deletions
@@ -213,6 +213,19 @@ uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
return count;
}
uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) const
{
uint32 count = 0;
for (uint32 i = 0; i < GetBagSize(); ++i)
if (Item *pItem = m_bagslot[i])
if (pItem != skipItem)
if (ItemPrototype const *pProto = pItem->GetProto())
if (pProto->ItemLimitCategory == limitCategory)
count += m_bagslot[i]->GetCount();
return count;
}
uint8 Bag::GetSlotByItemGUID(uint64 guid) const
{
for (uint32 i = 0; i < GetBagSize(); ++i)
@@ -45,6 +45,7 @@ class Bag : public Item
Item* GetItemByPos(uint8 slot) const;
uint32 GetItemCount(uint32 item, Item* eItem = NULL) const;
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
uint8 GetSlotByItemGUID(uint64 guid) const;
bool IsEmpty() const;