From fcbc8a284aab346c04ea5777e0c6c9649983ce43 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 10 七月 2026 16:43:29 +0800
Subject: [PATCH] 0312 同步满掉落背包优化

---
 Main/System/KnapSack/PackManager.cs                  |   31 ++++++++++++++++++++++++++++++-
 Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs |    1 +
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index 4a734f2..27549e2 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -176,6 +176,7 @@
         Register(typeof(HA525_tagSCFamilyAtkDefBatInfo), typeof(DTCA525_tagSCFamilyAtkDefBatInfo));
         Register(typeof(HAA90_tagSCActLianqiInfo), typeof(DTCAA90_tagSCActLianqiInfo));
         Register(typeof(HAA91_tagSCActLianqiPlayerInfo), typeof(DTCAA91_tagSCActLianqiPlayerInfo));
+        Register(typeof(HA208_tagSCDropPackFull), typeof(DTCA208_tagSCDropPackFull));
     }
 
     //涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/System/KnapSack/PackManager.cs b/Main/System/KnapSack/PackManager.cs
index 9ab0a5f..e656895 100644
--- a/Main/System/KnapSack/PackManager.cs
+++ b/Main/System/KnapSack/PackManager.cs
@@ -170,6 +170,27 @@
             playerPackDict.Add(packType, new SinglePack(packType));
         }
 
+        // 鍏堝垹闄ゆ墍鏈夌墿鍝� 涓嶆鐧诲綍鐨勬椂鍊欎細鍙戯紝鍏朵粬鎯呭喌琛ュ彂
+        var singlePack = playerPackDict[packType];
+        List<string> guidList = new List<string>();
+        if (singlePack != null)
+        {
+            foreach (var item in singlePack.GetAllItems().Values)
+            {
+                guidList.Add(item.guid);
+            }
+            singlePack.Clear();
+            foreach (var guid in guidList)
+            {
+                if (itemGUIDDict.ContainsKey(guid))
+                {
+                    if (itemGUIDDict[guid].packType == packType)
+                    {
+                        itemGUIDDict.Remove(guid);
+                    }
+                }
+            }
+        }
 
         for (int i = 0; i < packInfo.ItemCount; i++)
         {
@@ -613,7 +634,15 @@
         return PackMaxCountDict[(int)type] - GetSinglePack(type).unlockedGridCount;
     }
 
-
+    public int GetPackMaxCount(PackType type)
+    {
+        if (!PackMaxCountDict.ContainsKey((int)type))
+        {
+            return 0;
+        }
+        return PackMaxCountDict[(int)type];
+    }
+    
     private void UpdateSecond()
     {
         if (isItemChange)

--
Gitblit v1.8.0