432
edits
No edit summary |
(Allow optional comma separated list of items) |
||
Line 321: | Line 321: | ||
function p.getDiscoveryRewardsTable(frame) | function p.getDiscoveryRewardsTable(frame) | ||
local itemNames = frame.args ~= nil and frame.args or frame | local itemNames = frame.args ~= nil and frame.args[1] or frame | ||
local items = {} | local items = {} | ||
for | for itemName in string.gmatch(itemNames, "[^,]*") do | ||
item = Items.getItem(itemName) | item = Items.getItem(itemName) | ||
if item ~= nil then | if item ~= nil then | ||
items | table.insert(items, item) | ||
end | end | ||
end | end | ||
if #items == nil then | if #items == nil then | ||
return Shared.printError('No items found for | return Shared.printError('No items found in game data for: "' .. itemNames .. '"') | ||
end | end | ||
local resultTable = p._getDiscoveryRewardsTable(items) | local resultTable = p._getDiscoveryRewardsTable(items) |
edits