Core/Spells: Restored totem category check

Revert "Core/Totems: In cata totem items are no longer needed"

This reverts commit 45e0cae7be

(cherry picked from commit ea9eccae8596d440c372b0d9709d4def4b46e648)

Conflicts:
	src/server/game/Entities/Item/ItemPrototype.h
This commit is contained in:
Shauren authored and Duarte Duarte committed 2015-02-22 06:06:34 +00:00
1 parent 8aa7c1995b
commit 6cc38ad7d2
4 files changed
+50 -2

No files matched your search

@@ -10742,6 +10742,34 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& des
return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL);
}
bool Player::HasItemTotemCategory(uint32 TotemCategory) const
{
Item* item;
for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i);
if (item && IsTotemCategoryCompatibleWith(item->GetTemplate()->GetTotemCategory(), TotemCategory))
return true;
}
Bag* bag;
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
bag = GetBagByPos(i);
if (bag)
{
for (uint32 j = 0; j < bag->GetBagSize(); ++j)
{
item = GetUseableItemByPos(i, j);
if (item && IsTotemCategoryCompatibleWith(item->GetTemplate()->TotemCategory, TotemCategory))
return true;
}
}
}
return false;
}
InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec &dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const
{
Item* pItem2 = GetItemByPos(bag, slot);