Module:Sandbox/LVL: Difference between revisionsGive feedback
No edit summary |
No edit summary |
||
| Line 116: | Line 116: | ||
local number_int = tonumber(number_str) | local number_int = tonumber(number_str) | ||
local localize = frame.args[4] | local localize = frame.args[4] | ||
local hero = heroes_data[hero_name] | |||
if(hero == nil) then hero = p.get_json_item(hero_name) end | local hero = heroes_data[hero_name] | ||
if(hero == nil) then return "Hero Not Found" end -- | if(hero == nil) then hero = p.get_json_item(hero_name) end | ||
if(hero == nil) then return "Hero Not Found" end | |||
-- Check top-level first, then Weapon, then AltFire | |||
local list = hero[var] | local list = hero[var] | ||
if list == nil and hero.Weapon then | |||
list = hero.Weapon[var] | |||
end | |||
if list == nil and hero.Weapon and hero.Weapon.AltFire then | |||
list = hero.Weapon.AltFire[var] | |||
end | |||
if (list == nil) then return "" end | if (list == nil) then return "" end | ||
local element = list[number_int] | local element = list[number_int] | ||