Module:HeroData: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m return empty string directly
Sur (talk | contribs)
m get_her_scalar_str requires hero_data instead of hero_name now
Line 43: Line 43:
local hero_name = frame.args[1]
local hero_name = frame.args[1]
local hero_stat_key = frame.args[2]
local hero_stat_key = frame.args[2]
local hero_data = get_json_item(hero_name)
return p.get_hero_scalar_str(hero_name, hero_stat_key) --surely theres a better way
if(hero == nil) then return "Hero Not Found" end
return p.get_hero_scalar_str(hero_data, hero_stat_key) --surely theres a better way
end
end


function p.get_hero_scalar_str(hero_name, hero_stat_key)
function p.get_hero_scalar_str(hero, hero_stat_key)
local hero = get_json_item(hero_name)
if(hero == nil) then return "Hero Not Found" end
local scaling_type_full
local scaling_type_full
local scaling_data
local scaling_data