17,030
edits
mNo edit summary |
mNo edit summary |
||
Line 65: | Line 65: | ||
end | end | ||
function p.getItem(name) | function p.getItem(name, noClone) | ||
if noClone == nil then noClone = false end | |||
name = string.gsub(name, "%%27", "'") | name = string.gsub(name, "%%27", "'") | ||
name = string.gsub(name, "'", "'") | name = string.gsub(name, "'", "'") | ||
Line 72: | Line 72: | ||
local itemName = string.gsub(item.name, '#', '') | local itemName = string.gsub(item.name, '#', '') | ||
if(name == itemName) then | if(name == itemName) then | ||
return item | if noClone then | ||
return item | |||
else | |||
local result = Shared.clone(item) | |||
result.id = i - 1 | |||
return result | |||
end | |||
end | end | ||
end | end |