Module:HeroData: Difference between revisionsGive feedback
m write_stat_infoboxes now uses hero key instead of hero name |
m get_list_elem also allows key being passed |
||
| Line 77: | Line 77: | ||
local number_int = tonumber(number_str) | local number_int = tonumber(number_str) | ||
local localize = frame.args[4] | local localize = frame.args[4] | ||
local hero = p.get_json_item(hero_name) | local hero = heroes_data[hero_name] --check if hero key is passed instead | ||
if(hero == nil) then hero = p.get_json_item(hero_name) end --check if hero name is passed | |||
if(hero == nil) then return "Hero Not Found" end --both invalid, error | |||
if (hero == nil) then return "Hero " .. hero_name .. " not found" end | if (hero == nil) then return "Hero " .. hero_name .. " not found" end | ||
local list = hero[var] | local list = hero[var] | ||