Module:Infobox: Difference between revisions

keep existence check
Line 118: Line 118:
table.sort( invImgCount )
table.sort( invImgCount )
local slot
local slot
local invTitle = mw.title.new( 'Media:Invicon ' .. title .. '.png' )
local invAliases = mw.loadData( 'Module:Inventory slot/Aliases' )
for k, v in ipairs( invImgCount ) do
for k, v in ipairs( invImgCount ) do
local image = args['invimage' .. v]
local image = args['invimage' .. v]
if image == 'title' then
if image == 'title' then
image = title
if invTitle and invTitle.exists or invAliases[title] then
image = title
else
image = false
end
end
end