From 384b3b35c34dd80ec85ad14ddbfe6607b42ddd96 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Wed, 26 Aug 2020 15:00:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E9=98=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Formation/FormationManager.lua | 6 +++++- Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index 47e5219977..8abf272991 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -421,11 +421,15 @@ end -- 获取所有正在编队的英雄id function this.AllFormationDeleCurHeroId(heroDid) for i, team in pairs(this.formationList) do + local removeIndex for j = 1, #team.teamHeroInfos do if team.teamHeroInfos[j] and team.teamHeroInfos[j].heroId == heroDid then - team.teamHeroInfos[j] = nil + removeIndex = j end end + if removeIndex then + table.remove( team.teamHeroInfos, removeIndex) + end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua index 12f110dd3d..8ae3cc973e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua @@ -650,7 +650,7 @@ function this.GetUpStarHeroListData(heroRankUpGroupId, heroData) for n, w in pairs(FormationManager.formationList) do if this.heroResolveLicence[n] then for m = 1, #w.teamHeroInfos do - if v.dynamicId == w.teamHeroInfos[m].heroId then + if w.teamHeroInfos[m] and v.dynamicId == w.teamHeroInfos[m].heroId then local isFormationStr = this.GetHeroFormationStr(n) v.isFormation = isFormationStr end