yyl
2025-08-25 cec8b67d82c2c2c1662d55c818c4a46bcc0487db
Main/System/Battle/BattleManager.cs
@@ -168,7 +168,7 @@
            Debug.LogWarning($"连续空战斗片段封包次数:{continousEmptyCount}");
            if (continousEmptyCount >= MaxContinousEmptyCount)
            {
                Debug.LogError("连续多次没有战斗片段封包,自动回城休息!");
                BattleDebug.LogError("连续多次没有战斗片段封包,自动回城休息!");
                MainFightRequest(0); // 0-停止战斗回城
                continousEmptyCount = 0;
                packQueue.Clear();
@@ -191,21 +191,32 @@
    {
        if (packQueue.Count > 0)
        {
            GameNetPackBasic pack = packQueue.Dequeue();
            GameNetPackBasic pack = packQueue.Peek();
            bool dequeue = false;
            if (pack is CustomHB426CombinePack)
            {
                CustomHB426CombinePack combinePack = pack as CustomHB426CombinePack;
                packQueue.Dequeue();
                combinePack.Distribute();
            }
            else if (pack is CustomB421ActionPack)
            {
                CustomB421ActionPack actionPack = pack as CustomB421ActionPack;
                actionPack.Distribute();
                dequeue = !actionPack.Distribute();
            }
            else
            {
                BattleDebug.LogError("distribute pack " + pack.GetType().Name);
                packQueue.Dequeue();
                PackageRegedit.Distribute(pack);
            }
            if (dequeue && packQueue.Count > 0)
            {
                packQueue.Dequeue();
            }
            return true;
@@ -287,17 +298,22 @@
        if (!battleReportDict.TryGetValue(guid, out queue))
        {
            Debug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid);
            BattleDebug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid);
            return;
        }
        PackageRegedit.Distribute(queue.Dequeue());
        var pack = queue.Dequeue();
        BattleDebug.LogError("distribute pack " + pack.GetType().Name);
        PackageRegedit.Distribute(pack);
        if (queue.Count <= 0)
        {
            battleReportDict.Remove(guid);
            battlePackRelationList.Remove(guid);
        }
        BattleDebug.LogError("BattlePackage count is " + queue.Count);
    }
    #endregion
@@ -307,7 +323,7 @@
        if (battleFields.TryGetValue(guid, out battleField))
        {
            Debug.LogError("战场已存在 先进行销毁");
            BattleDebug.LogError("战场已存在 先进行销毁");
            battleField.Destroy();
        }
@@ -331,7 +347,7 @@
    {
        if (battleField == null)
        {
            Debug.LogError("DestroyBattleField called with null battleField");
            BattleDebug.LogError("DestroyBattleField called with null battleField");
            return;
        }