From 2bdca925498c2b06de803cd6ec1704faef8eec30 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 18 十月 2018 15:34:27 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Pet/PlayerPetDatas.cs |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/System/Pet/PlayerPetDatas.cs b/System/Pet/PlayerPetDatas.cs
index 5fb219c..cced869 100644
--- a/System/Pet/PlayerPetDatas.cs
+++ b/System/Pet/PlayerPetDatas.cs
@@ -353,26 +353,20 @@
         }
     }
 
-    public int GetMinPetLv()
+    public int GetMinPetExp()
     {
         int GetPetId = 0;
-        int petLv = 0;
-
+        int NeedExp = 99999999;
         for (int i = 0; i < Sortpet.Count; i++)
         {
             int petID = Sortpet[i].ID;
-            if (_DicPetBack.ContainsKey(petID))
+            if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < Config.Instance.Get<PetInfoConfig>(petID).MaxRank)
             {
-                var key = petID;
-                if (petLv == 0 && _DicPetBack[key].PetClass < GetPetSkillMaxLv(key))
+                int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
+                if (_NeedExp - _DicPetBack[petID].petExp < NeedExp)
                 {
-                    petLv = _DicPetBack[key].PetClass;
-                    GetPetId = key;
-                }
-                if (_DicPetBack[key].PetClass < petLv && _DicPetBack[key].PetClass < GetPetSkillMaxLv(key))
-                {
-                    petLv = _DicPetBack[key].PetClass;
-                    GetPetId = key;
+                    NeedExp = _NeedExp - _DicPetBack[petID].petExp;
+                    GetPetId = petID;
                 }
             }
         }

--
Gitblit v1.8.0