Module:HeroData: Difference between revisionsGive feedback
m moving headcount to HeroData/headcount |
m get_hero_release_status initial |
||
| Line 15: | Line 15: | ||
end | end | ||
end | end | ||
return nil | |||
end | |||
-- function for if the hero is released, or in herolabs | |||
-- logic may change in the future as Valve adds more flags | |||
function p.get_hero_release_status(hero_key) | |||
local hero_data = heroes_data[hero_key] | |||
if (hero_data == nil) then return "hero_key " .. hero_key .. " is not a hero" end | |||
local in_herolabs = hero_data['InHeroLabs'] and hero_data['IsSelectable'] | |||
if in_herolabs == nil then in_herolabs = false end | |||
if in_herolabs then | |||
return "HeroLabs" | |||
elseif not hero_data['IsDisabled'] and not hero_data['InDevelopment'] and hero_data['IsSelectable'] then | |||
return "Released" | |||
end | |||
return nil | return nil | ||
end | end | ||