Module:Items: Difference between revisions

_getItemStat: Use default attack speed for weapons without the attackSpeed property
(_getItemCategories: Use same logic as _getItemStat for item category)
(_getItemStat: Use default attack speed for weapons without the attackSpeed property)
Line 45: Line 45:
     if item.equipmentStats ~= nil and item.equipmentStats[StatName] ~= nil then
     if item.equipmentStats ~= nil and item.equipmentStats[StatName] ~= nil then
result = item.equipmentStats[StatName]
result = item.equipmentStats[StatName]
    elseif StatName == 'attackSpeed' and item.validSlots ~= nil and not Shared.contains(item.validSlots, 'Weapon') then
-- Item can be equipped as a weapon but has no attack speed, so use default of 4000ms
result = 4000
elseif StatName == 'isTwoHanded' then
elseif StatName == 'isTwoHanded' then
if item.validSlots ~= nil and item.occupiesSlots ~= nil then
if item.validSlots ~= nil and item.occupiesSlots ~= nil then