From f94fa55d1f4515889824346d881d0744c960a2da Mon Sep 17 00:00:00 2001
From: Client_PangDeRong <593317293@qq.com>
Date: 星期三, 12 九月 2018 17:57:51 +0800
Subject: [PATCH] 1495 修复合成点击出现无法合成问题

---
 System/Compose/New/ComposeWin.cs      |    3 +++
 System/Compose/New/ComposeWinModel.cs |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/System/Compose/New/ComposeWin.cs b/System/Compose/New/ComposeWin.cs
index 9b880b5..16496fc 100644
--- a/System/Compose/New/ComposeWin.cs
+++ b/System/Compose/New/ComposeWin.cs
@@ -43,6 +43,8 @@
             get { return _composeModel ?? (_composeModel = ModelCenter.Instance.GetModel<ComposeWinModel>()); }
         }
 
+        SelectEquipModel selectModel { get { return ModelCenter.Instance.GetModel<SelectEquipModel>(); } }
+
         #region Built-in
         protected override void BindController()
         {
@@ -121,6 +123,7 @@
 
         protected override void OnPreClose()
         {
+            selectModel.ClearSelectModel();
         }
 
         protected override void OnAfterClose()
diff --git a/System/Compose/New/ComposeWinModel.cs b/System/Compose/New/ComposeWinModel.cs
index 5e2296d..a37bf75 100644
--- a/System/Compose/New/ComposeWinModel.cs
+++ b/System/Compose/New/ComposeWinModel.cs
@@ -201,6 +201,7 @@
     /// </summary>
     private byte[] fixedIndexArray = null;
     private byte[] addonsReduceArray = null;
+    private byte[] unfixedIndexArray = null;
     Dictionary<int, Dictionary<int, int>> fixedMatIsBindDict = new Dictionary<int, Dictionary<int, int>>();  //id , isBind, count
     Dictionary<int, Dictionary<int, int>> unfixedMatIsBindDict = new Dictionary<int, Dictionary<int, int>>();
 
@@ -273,7 +274,15 @@
             }
         }
 
-        byte[] unfixedIndexArray = DictToArray(selectModel.GetHaveUnfixedSelectItem());
+        if(compoundModel.unfixedItemCount > 0)
+        {
+            DictToArray(selectModel.GetHaveUnfixedSelectItem());
+        }
+        else
+        {
+            unfixedIndexArray = null;
+        }
+
         if (unfixedIndexArray != null)
         {
             for (i = 0; i < unfixedIndexArray.Length; i++)
@@ -592,6 +601,8 @@
 
     private void SetMatIsBindDict(ItemModel itemModel,Dictionary<int, Dictionary<int, int>> matDict)
     {
+        if (itemModel == null) return;
+
         if (!matDict.ContainsKey(itemModel.itemId))
         {
             Dictionary<int, int> bindDict = new Dictionary<int, int>();

--
Gitblit v1.8.0