Module:Items: Difference between revisions

Changed duplicate function name
(Added unified 'getItemSources' function)
(Changed duplicate function name)
Line 991: Line 991:
end
end


function p._getItemSources(item)
function p._getItemSourceTables(item)
   local result = ''
   local result = ''
   local creationTable = p._getCreationTable(item)
   local creationTable = p._getCreationTable(item)
Line 997: Line 997:
   local lootTable = p._getItemLootSourceTable(item)
   local lootTable = p._getItemLootSourceTable(item)
   if string.len(lootTable) > 0 then
   if string.len(lootTable) > 0 then
     if string.len(result) > 0 then result = result..'<br/>' end
     if string.len(result) > 0 then result = result..'<br/>\r\n' end
     result = result..lootTable
     result = result..lootTable
   end
   end
Line 1,003: Line 1,003:
end
end


function p.getItemSources(frame)
function p.getItemSourceTables(frame)
   local itemName = frame.args ~= nil and frame.args[1] or frame
   local itemName = frame.args ~= nil and frame.args[1] or frame
   local item = p.getItem(itemName)
   local item = p.getItem(itemName)
Line 1,010: Line 1,010:
   end
   end


   return p._getItemSources(item)
   return p._getItemSourceTables(item)
end
end