hch
2025-08-18 5c5a5cc66227439be7a7b61da5d1ff68cf187ac3
Main/System/Team/TeamBase.cs
@@ -226,6 +226,18 @@
        return false;
    }
    public bool HasHeroInServer(string guid)
    {
        foreach (var hero in serverHeroes)
        {
            if (hero != null && hero.guid == guid)
            {
                return true;
            }
        }
        return false;
    }
    //客户端从0开始,服务端从1开始
    public int GetEmptyPosition()
    {
@@ -270,17 +282,7 @@
            return;
        }
        TeamHero targetHero = tempHeroes[targetPosition];
        if (null == targetHero)
        {
            TeamHero newHero = new TeamHero(heroInfo, targetPosition, this);
            SetTeamHero(targetPosition, newHero);
        }
        else
        {
            SetTeamHero(targetPosition, new TeamHero(heroInfo, targetPosition, this));
        }
        SetTeamHero(targetPosition, new TeamHero(heroInfo, targetPosition, this));
    }