Module:ItemData: Difference between revisions

added raw variable for get_prop, get_property_upgrades to get data without suffixes
No edit summary
Line 400: Line 400:
if upgrades == nil then return nil end
if upgrades == nil then return nil end


local prop_upgrades = upgrades[property]
local value = upgrades[property]
if prop_upgrades == nil then return nil end
if value == nil then return nil end


-- Convert upgrade values to strings
local result = raw and strip_suffix(value) or tostring(value)
local values = {}
for _, v in ipairs(prop_upgrades) do
table.insert(values, raw and strip_suffix(v) or tostring(v))
end
 
local result = table.concat(values, ", ")


if raw then
if raw then