diff --git a/lua/app/ui/tips/hero_fragment_tips.lua b/lua/app/ui/tips/hero_fragment_tips.lua index e1d6dc21..5c5053a1 100644 --- a/lua/app/ui/tips/hero_fragment_tips.lua +++ b/lua/app/ui/tips/hero_fragment_tips.lua @@ -23,7 +23,7 @@ function HeroFragmentTips:onLoadRootComplete() end self.heroList = {} for _, v in ipairs(drop) do - if DataManager.HeroData:getHeroIsActive(v.id) then + if DataManager.HeroData:getHeroIsUnlock(v.id) then table.insert(self.heroList, v.id) end end diff --git a/lua/app/userdata/hero/hero_data.lua b/lua/app/userdata/hero/hero_data.lua index 5f6c9964..32f6be65 100644 --- a/lua/app/userdata/hero/hero_data.lua +++ b/lua/app/userdata/hero/hero_data.lua @@ -84,6 +84,15 @@ function HeroData:getHeroIsActive(id) return entity:isActived() end + +function HeroData:getHeroIsUnlock(id) + local entity = self.heroes[id] + if entity == nil then + return false + end + return entity:isUnlock() +end + function HeroData:getUnlockHeroCount() local count = 0 for id, entity in pairs(self.heroes) do