diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index df3cbc3f2f..613718b4aa 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -119,7 +119,7 @@ function this.RefreshFormation(index, roleList, pokemonList,isDiffmonster) Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnFormationChange,isDiffmonster) end) - this.UserPowerChanged() + this.CheckHeroIdExist() end @@ -209,13 +209,18 @@ end --某个妖灵师战力发生变化检查是否在任何一个编队 function this.CheckHeroIdExist(heroId) - for _, formationData in pairs(this.formationList) do - table.walk(formationData.teamHeroInfos, function(teamInfo) - if heroId == teamInfo.heroId then - this.UserPowerChanged() + if not heroId then + NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL) + return + end + + -- for _, formationData in pairs(this.formationList) do + table.walk(this.formationList[FormationTypeDef.FORMATION_NORMAL].teamHeroInfos, function(teamInfo) + if heroId == teamInfo.heroId then + NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL) end end) - end + -- end end function this.UserPowerChanged()