Anonymous

Module:Attacks/Tables: Difference between revisions

From Melvor Idle
Fix for unknown items
(Use tabs instead of spaces for indentation)
(Fix for unknown items)
Line 53: Line 53:
for j, itemID in ipairs(spAtt.items) do
for j, itemID in ipairs(spAtt.items) do
local item = Items.getItemByID(itemID)
local item = Items.getItemByID(itemID)
table.insert(spAttTable, { idx = i, source = 'Weapon', sourceSort = item.name, sourceText = Icons.Icon({ item.name, type = 'item' }), chance = spAtt.defaultChance, descType = 'player' })
if item ~= nil then
table.insert(spAttTable, { idx = i, source = 'Weapon', sourceSort = item.name, sourceText = Icons.Icon({ item.name, type = 'item' }), chance = spAtt.defaultChance, descType = 'player' })
end
end
end
end
end