Module:Abilities: Difference between revisions

naming
LVL (talk | contribs)
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 == 'table') then
if element == nil then return "" end
  local list1 = element[upgrade_tier]
 
  local element = list1
-- if the property is a table, return its Value field
      if (list1 == 'table') then
if type(element) == "table" then
local list2 = list1[number_int]
    return element.Value or ""
local element = list2
end
end
end
 
if (element == nil) then return "" end
-- otherwise return the scalar value
return element
return element
end
end


return p
return p