17,105
edits
m (Accidental reversion, oops) |
(Don't clone items, as all items have IDs from game data anyway (and hope nowhere else is attempting to modify them)) |
||
Line 68: | Line 68: | ||
function p.getItemByID(ID) | function p.getItemByID(ID) | ||
return ItemData.Items[ID + 1] | |||
end | end | ||
function p.getItem(name) | function p.getItem(name) | ||
name = string.gsub(name, "%%27", "'") | name = string.gsub(name, "%%27", "'") | ||
name = string.gsub(name, "'", "'") | name = string.gsub(name, "'", "'") | ||
Line 82: | Line 77: | ||
local itemName = string.gsub(item.name, '#', '') | local itemName = string.gsub(item.name, '#', '') | ||
if name == itemName then | if name == itemName then | ||
return p.getItemByID(i - 1) | |||
end | end | ||
end | end | ||
return | return nil | ||
end | end | ||
Line 95: | Line 87: | ||
for i, item in pairs(ItemData.Items) do | for i, item in pairs(ItemData.Items) do | ||
if checkFunc(item) then | if checkFunc(item) then | ||
table.insert(result, item) | |||
table.insert(result, | |||
end | end | ||
end | end |