17,105
edits
(Fix Bob's Rake style override) |
(getItemUpgradeTable: Avoid determining the stat change for upgraded items unless necessary) |
||
Line 468: | Line 468: | ||
local matArray = {} | local matArray = {} | ||
for i, itemCost in ipairs(upgrade.itemCosts) do | for i, itemCost in ipairs(upgrade.itemCosts) do | ||
local mat = Items.getItemByID(itemCost.id) | local mat = Items.getItemByID(itemCost.id) | ||
if mat ~= nil then | if mat ~= nil then | ||
table.insert(matArray, Icons.Icon({mat.name, type='item', qty=itemCost.quantity})) | table.insert(matArray, Icons.Icon({mat.name, type='item', qty=itemCost.quantity})) | ||
end | end | ||
end | end | ||
Line 487: | Line 483: | ||
if useStatChange then | if useStatChange then | ||
table.insert(resultPart, '||'..statChangeString) | -- Generate stat change column | ||
local statChangeString = '' | |||
if not Shared.tableIsEmpty(upgrade.rootItemIDs) then | |||
-- Some items (e.g. FEZ) may have multiple root items. Simply use the first one | |||
local rootItem = Items.getItemByID(upgrade.rootItemIDs[1]) | |||
if rootItem ~= nil then | |||
statChangeString = Items.getStatChangeString(item, rootItem) | |||
end | |||
end | |||
table.insert(resultPart, '|| '..statChangeString) | |||
end | end | ||
end | end |