[11227] Fixed item search by guid in bank item slots.

This commit is contained in:
VladimirMangos 2011-03-06 18:46:28 +03:00
parent 275928e504
commit ad6ab0bc49
2 changed files with 6 additions and 1 deletions

View file

@ -9148,6 +9148,11 @@ Item* Player::GetItemByGuid(ObjectGuid guid) const
if (pItem->GetObjectGuid() == guid)
return pItem;
for(int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i)
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem->GetObjectGuid() == guid)
return pItem;
for(int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i))
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)