尝试修复编队和角色装备界面报错的问题
parent
a4bcead414
commit
4c93923b39
|
|
@ -129,8 +129,11 @@ function this.GetAllFormationHeroId()
|
|||
local index = 1
|
||||
for i, team in pairs(this.formationList) do
|
||||
for j = 1, #team.teamHeroInfos do
|
||||
list[team.teamHeroInfos[j].heroId] = index
|
||||
index = index + 1
|
||||
-- 加空判断避免不知名错误
|
||||
if team and team.teamHeroInfos[j] then
|
||||
list[team.teamHeroInfos[j].heroId] = index
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
return list
|
||||
|
|
|
|||
|
|
@ -277,7 +277,10 @@ function this.RefreshFormation()
|
|||
this.choosedList ={}
|
||||
for j = 1, #curFormation.teamHeroInfos do
|
||||
local teamInfo = curFormation.teamHeroInfos[j]
|
||||
table.insert(this.choosedList, {heroId =teamInfo.heroId,position=teamInfo.position})
|
||||
-- 加空判断避免不知名错误
|
||||
if teamInfo then
|
||||
table.insert(this.choosedList, {heroId =teamInfo.heroId,position=teamInfo.position})
|
||||
end
|
||||
end
|
||||
this.order = #this.choosedList
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue