编队bug

dev_chengFeng
zhangqiang 2020-08-26 11:26:32 +08:00
parent a86e5b6d4c
commit 4bc63fb367
2 changed files with 8 additions and 4 deletions

View File

@ -111,9 +111,11 @@ function this.RefreshFormation(index, roleList, pokemonList,isDiffmonster)
end
local oldTeamheroInfos = {}
for i = 1, #curFormation.teamHeroInfos do
oldTeamheroInfos[curFormation.teamHeroInfos[i].heroId] = curFormation.teamHeroInfos[i]
if not newTeamheroInfos[curFormation.teamHeroInfos[i].heroId] then
HeroManager.SetHeroFormationList(curFormation.teamHeroInfos[i].heroId,this.formationList[index].teamId,nil)
if curFormation.teamHeroInfos[i] then
oldTeamheroInfos[curFormation.teamHeroInfos[i].heroId] = curFormation.teamHeroInfos[i]
if not newTeamheroInfos[curFormation.teamHeroInfos[i].heroId] then
HeroManager.SetHeroFormationList(curFormation.teamHeroInfos[i].heroId,this.formationList[index].teamId,nil)
end
end
end

View File

@ -520,7 +520,9 @@ function this.SortHeroDatas(_heroDatas)
end
for j = 1, #curFormation.teamHeroInfos do
local teamInfo = curFormation.teamHeroInfos[j]
choosed[teamInfo.heroId] = j
if teamInfo then
choosed[teamInfo.heroId] = j
end
end
table.sort(_heroDatas, function(a, b)