【ID1018514】

【四灵试炼】线上号,打开战斗编队报错
dev_chengFeng
jiaoyangna 2021-09-18 11:02:32 +08:00
parent 0e86945c53
commit ac319513dc
1 changed files with 13 additions and 5 deletions

View File

@ -64,21 +64,27 @@ end
--刷新编队数据
function this.UpdateFormation(msg)
Log("编队数量:" .. #msg.TeamPosInfo)
this.formationList = {}
-- this.curFormationIndex = this.SetCurFormationIndex()
this.curFormationIndex = 1
for i, team in ipairs(msg.TeamPosInfo) do
LogGreen("team.teamId:"..team.teamId)
local isRefresh = false
local oTeam = this.MakeAEmptyTeam(team.teamId)
for j = 1, #team.teamHeroInfos do
local teamHeroInfo = team.teamHeroInfos[j]
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
if HeroManager.GetSingleHeroData(teamHeroInfo.heroId) then
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
else
isRefresh = true
end
end
oTeam.teamPokemonInfos = {}
this.formationList[team.teamId] = oTeam
if isRefresh then
FormationManager.RefreshFormation(team.teamId, this.formationList[team.teamId].teamHeroInfos, {})
end
end
if #msg.TeamPosInfo == 0 then
@ -205,7 +211,9 @@ function this.GetFormationByID(teamId)
local _v=tonumber(v)
if teamId==_v and #this.formationList[teamId].teamHeroInfos<=0 then
for n = 1, #this.formationList[1].teamHeroInfos do
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
if HeroManager.GetSingleHeroData(this.formationList[1].teamHeroInfos.heroId) then
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
end
end
--
FormationManager.RefreshFormation(teamId, this.formationList[teamId].teamHeroInfos, {})