From ba4d3d21ba7ee923021dc46bed3e59ed7ae092dd Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 18 九月 2018 11:48:27 +0800
Subject: [PATCH] 1955 【前端】不能使用低级材料,没有及时清除低级材料还可以继续使用

---
 System/Treasure/TreasurePotentialPanel.cs |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/System/Treasure/TreasurePotentialPanel.cs b/System/Treasure/TreasurePotentialPanel.cs
index 8314cbe..c9e0715 100644
--- a/System/Treasure/TreasurePotentialPanel.cs
+++ b/System/Treasure/TreasurePotentialPanel.cs
@@ -739,6 +739,26 @@
             }
         }
 
+        private bool ContainsPotentialBook(int potentialBook)
+        {
+            if (potentialBook == 0)
+            {
+                return false;
+            }
+            var potential = m_Treasure.GetPotential(selectedPotential);
+            var levelUpType = model.GetSkillLevelUpType(potential.id);
+            var levelupId = TreasureModel.GetSkillLevelUpId(levelUpType, potential.level + 1);
+            var config = Config.Instance.Get<TreasureSkillConfig>(levelupId);
+            for (int i = 0; i < config.Meterial2ID.Length; i++)
+            {
+                if (config.Meterial2ID[i] == potentialBook)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
         private int GetNextPotential(int _potentialId)
         {
             for (int i = 0; i < m_Treasure.potentials.Count; i++)
@@ -785,8 +805,9 @@
                     }
                 }
             }
+
             var levelUpConfig = GetPotentialLevelUpConfig();
-            if (levelUpConfig.own < levelUpConfig.need)
+            if (levelUpConfig.own < levelUpConfig.need || !ContainsPotentialBook(model.selectedPotentialBook))
             {
                 model.selectedPotentialBook = 0;
             }

--
Gitblit v1.8.0