Module:Abilities: Difference between revisionsGive feedback
Gammaton32 (talk | contribs) naming |
Fixed get_ability_prop to return element.Value for table props |
||
| Line 46: | Line 46: | ||
--identify if prop1 is a table, then use prop2-- | --identify if prop1 is a table, then use prop2-- | ||
local element = ability[prop1] | local element = ability[prop1] | ||
if element == nil then return "" end | |||
-- if the property is a table, return its Value field | |||
if type(element) == "table" then | |||
return element.Value or "" | |||
end | end | ||
-- otherwise return the scalar value | |||
return element | return element | ||
end | end | ||
return p | return p | ||