Module:Abilities: Difference between revisionsGive feedback
Normalize data for get_ability_number |
mNo edit summary Tag: Undo |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 127: | Line 127: | ||
return "Ability Not Found" | return "Ability Not Found" | ||
end | end | ||
-- Get the list of upgrades for this ability | -- Get the list of upgrades for this ability | ||
local upgrades = ability.Upgrades | local upgrades = ability.Upgrades | ||
| Line 148: | Line 148: | ||
-- Get the desired property from the specific upgrade | -- Get the desired property from the specific upgrade | ||
local element = upgrade[prop] | local element = upgrade[prop] | ||
if | if prop and prop ~= "" then | ||
for segment in string.gmatch(prop, "[^%.]+") do | |||
-- If upgrade is not a table, return value. If it is, check for segments | |||
if type(element) ~= "table" then | |||
return element or "" | |||
end | |||
element = element[segment] | |||
if element == nil then return "" end | |||
end | |||
end | end | ||