diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua index 060578c2a8..632ee8c644 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua @@ -314,6 +314,8 @@ function this.On_Btn2_Click() --检测三个队伍是否有重复英雄 local len = 0 + local upHeros={} + local isSame=false for key, value in pairs(allHeros) do local newHero={} newHero.heroId=value.Id @@ -325,13 +327,21 @@ function this.On_Btn2_Click() elseif value.index==2003 then table.insert(threeTeam,newHero) end + if BattleUtil.ChecklistIsContainValue(upHeros,value.Id) then + isSame=true + else + table.insert(upHeros,value.Id) + end len = len + 1 end if len <= 0 then PopupTipPanel.ShowTip(string.format(Language[10699], 1)) return end - + if isSame then + PopupTipPanel.ShowTip("编队中有相同神将") + return + end table.insert(allTeam,oneTeam) table.insert(allTeam,twoTeam) table.insert(allTeam,threeTeam) diff --git a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua index d6173e8296..abeb668457 100644 --- a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua @@ -101,9 +101,16 @@ local function OnEndDrag(self, Pointgo, data) self.curFormation[2000 + currIndex] = self.curFormation[2000 + targetIndex] self.curFormation[2000 + targetIndex] = tempFormation -- 保存 + local upHeros={} for i = 1, 3 do local heros = {} for _, hero in ipairs(self.curFormation[i+2000].teamHeroInfos) do + if BattleUtil.ChecklistIsContainValue(upHeros,hero.heroId) then + PopupTipPanel.ShowTip("编队中有相同神将!!") + return + else + table.insert(upHeros,hero.heroId) + end table.insert(heros, {heroId = hero.heroId, position = hero.position}) end FormationManager.SaveFormation(i+2000, heros,