Anonymous

Module:Items/UseTables: Difference between revisions

From Melvor Idle
_getItemUseTable: Resolve error when Summoning recipe uses GP or Slayer coins
(Fixed summoning reqs not scaling properly)
(_getItemUseTable: Resolve error when Summoning recipe uses GP or Slayer coins)
Line 506: Line 506:
       local matID = mat.id ~= nil and mat.id or mat[1]
       local matID = mat.id ~= nil and mat.id or mat[1]
       local matQty = mat.qty ~= nil and mat.qty or mat[2]
       local matQty = mat.qty ~= nil and mat.qty or mat[2]
       matItem = Items.getItemByID(matID)
       local matText = ''
     
       if i > 1 then result = result..'<br/>' end
       if i > 1 then result = result..'<br/>' end
       result = result..Icons.Icon({matItem.name, type='item', qty=matQty})
       if matID >= 0 then
        -- Item
        local matItem = Items.getItemByID(matID)
        if matItem == nil then
          matText = 'ERROR: Failed to find item with ID ' .. matID .. '[[Category:Pages with Script Errors]]'
        else
          matText = Icons.Icon({matItem.name, type='item', qty=matQty})
        end
      elseif matID == -4 then
        -- GP
        matText = Icons.GP(1000)
      elseif matID == -5 then
        -- Slayer Coins
        matText = Icons.SC(1000)
      else
        matText = 'ERROR: Unknown item ID: ' .. matID .. ' [[Category:Pages with Script Errors]]'
      end
      result = result .. matText
     end
     end
     if row.gp ~= nil then result = result..'<br/>'..Icons.GP(row.gp) end
     if row.gp ~= nil then result = result..'<br/>'..Icons.GP(row.gp) end