mirror of
https://github.com/mangosfour/server.git
synced 2026-01-01 16:37:12 +00:00
[9501] Implement item limit category inventory mode.
* Now expected item limit categories (for example for item 5513 and related) correctly limited by its amount in inventory. * Provide and use additional arg in SendEquipError for alt. way get affected item prototype. This let send to function item id and prevent crash client at limit category equip errors that required item prototype data.
This commit is contained in:
parent
52ace6bcb7
commit
c71f79584d
16 changed files with 137 additions and 56 deletions
|
|
@ -203,6 +203,17 @@ uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
|
|||
return count;
|
||||
}
|
||||
|
||||
uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory) const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for(uint32 i = 0; i < GetBagSize(); ++i)
|
||||
if (m_bagslot[i])
|
||||
if (m_bagslot[i]->GetProto()->ItemLimitCategory == limitCategory )
|
||||
count += m_bagslot[i]->GetCount();
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
uint8 Bag::GetSlotByItemGUID(uint64 guid) const
|
||||
{
|
||||
for(uint32 i = 0; i < GetBagSize(); ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue