Module:Items: Difference between revisions

_getItemCategories: Use same logic as _getItemStat for item category
(_getItemStat: Special handling for category)
(_getItemCategories: Use same logic as _getItemStat for item category)
Line 276: Line 276:
local resultPart = {}
local resultPart = {}
     local isEquipment = item.validSlots ~= nil or item.occupiesSlots ~= nil or item.equipmentStats ~= nil
     local isEquipment = item.validSlots ~= nil or item.occupiesSlots ~= nil or item.equipmentStats ~= nil
if item.category ~= nil then
    local category = p._getItemStat(item, 'category', false)
         table.insert(resultPart, '[[Category:'..item.category..']]')
if category ~= nil then
         table.insert(resultPart, '[[Category:'..category..']]')
     end
     end
if item.type ~= nil then
if item.type ~= nil then