Esempio n. 1
0
uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
{
    uint32 ContainerSlots=GetProto()->ContainerSlots;

    Item *pItem;
    uint32 count = 0;
    for(uint32 i=0; i < ContainerSlots; i++)
    {
        pItem = m_bagslot[i];
        if( pItem && pItem != eItem && pItem->GetEntry() == item )
            count += pItem->GetCount();
    }

    if(eItem && eItem->GetProto()->GemProperties)
    {
        for(uint32 i=0; i < ContainerSlots; i++)
        {
            pItem = m_bagslot[i];
            if( pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color )
                count += pItem->GetGemCountWithID(item);
        }
    }

    return count;
}
Esempio n. 2
0
uint32 Bag::GetItemCount(uint32 item, Item* eItem) const {
	Item *pItem;
	uint32 count = 0;
	for (uint32 i = 0; i < GetBagSize(); ++i) {
		pItem = m_bagslot[i];
		if (pItem && pItem != eItem && pItem->GetEntry() == item)
			count += pItem->GetCount();
	}

	if (eItem && eItem->GetProto()->GemProperties) {
		for (uint32 i = 0; i < GetBagSize(); ++i) {
			pItem = m_bagslot[i];
			if (pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color)
				count += pItem->GetGemCountWithID(item);
		}
	}

	return count;
}