Editing Module:AbilitiesGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 150: | Line 150: | ||
if prop and prop ~= "" then | if prop and prop ~= "" then | ||
for segment in string.gmatch(prop, "[^%.]+") do | for segment in string.gmatch(prop, "[^%.]+") do | ||
if type(element) ~= "table" then | if type(element) ~= "table" then | ||
return | return "" -- Can't traverse further | ||
end | end | ||
element = element[segment] | element = element[segment] | ||
if element == nil then return "" end | if element == nil then return "" end | ||
end | end | ||
end | |||
if element == nil then | |||
return "" -- The property doesn't exist in this specific upgrade, which is a valid case. Return empty. | |||
end | |||
-- If the property is a table (like a Damage object), return its Value field | |||
if type(element) == "table" then | |||
return element.Value or "" | |||
end | end | ||