* 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:
@@ -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;
|
||||
|
||||
@@ -120,10 +120,15 @@ enum InventoryChangeFailure
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78,
|
||||
EQUIP_ERR_CANNOT_TRADE_THAT = 79,
|
||||
EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80,
|
||||
// no output = 81,
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
|
||||
EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82,
|
||||
// no output = 83,
|
||||
// crash client = 84,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED = 84,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED = 85,
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86,
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87,
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED = 89
|
||||
};
|
||||
|
||||
enum BuyFailure
|
||||
|
||||
Reference in New Issue
Block a user