少年修仙传客户端代码仓库
client_Zxw
2018-12-05 9be17feb5bdb4e65afe92509ba4b889745d50bcc
System/Pet/PlayerPetDatas.cs
@@ -391,20 +391,22 @@
    }
    public int GetMinPetExp()
    {
        int GetPetId = 0;
        int NeedExp = 99999999;
        for (int i = 0; i < Sortpet.Count; i++)
    {
        foreach (var key in CultivateRedPoint.Keys)//当存在培养红点时,选中当有红点的那只
        {
            int petID = Sortpet[i].ID;
            if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < Config.Instance.Get<PetInfoConfig>(petID).MaxRank)
            if (CultivateRedPoint[key].state == RedPointState.Simple)
            {
                int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
                if (_NeedExp - _DicPetBack[petID].petExp < NeedExp)
                {
                    NeedExp = _NeedExp - _DicPetBack[petID].petExp;
                    GetPetId = petID;
                }
                return key;
            }
        }
        int GetPetId = 0;
        int GetPetLv = 999;
        foreach (var key in _DicPetBack.Keys)//无红点时跳转选中等级最低的
        {
            if (_DicPetBack[key].PetClass < GetPetLv)
            {
                GetPetId = key;
                GetPetLv = _DicPetBack[key].PetClass;
            }
        }
        return GetPetId;