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 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
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