Module:Items: Difference between revisions

Fixed check for WeaponAttackType for throwing knives and javelins
(Substitute links with Icons.Icon() where possible to benefit from ambiguous link handling)
(Fixed check for WeaponAttackType for throwing knives and javelins)
Line 215: Line 215:


function p._getWeaponAttackType(item)
function p._getWeaponAttackType(item)
   if item.isEquipment == true and item.validSlots ~= nil and Shared.contains(item.validSlots, 'Weapon') then
   if item.isEquipment == true and (item.validSlots ~= nil and Shared.contains(item.validSlots, 'Weapon')) or
  (item.occupiesSlots ~= nil  and Shared.contains(item.occupiesSlots, 'Weapon')) then
     if Shared.contains({'melee', 'ranged', 'magic'}, item.attackType) then
     if Shared.contains({'melee', 'ranged', 'magic'}, item.attackType) then
       local iconType = item.attackType ~= 'melee' and 'skill' or nil
       local iconType = item.attackType ~= 'melee' and 'skill' or nil