From eb2fcb2536a8cce0b971f827c9232a138262b219 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 17 九月 2025 17:34:57 +0800
Subject: [PATCH] 125 【战斗】战斗系统 boss战&战斗开始 倍速 跳过 暂停

---
 Main/System/Battle/BattleManager.cs |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index e801634..a21db8a 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -485,9 +485,11 @@
     {
         try
         {
-            foreach (var battleField in battleFields)
+            List<string> keys = new List<string>(battleFields.Keys);
+            for (int i = keys.Count - 1; i >= 0; i--)
             {
-                battleField.Value?.Run();
+                var battleField = battleFields[keys[i]];
+                battleField?.Run();
             }
         }
         catch (System.Exception ex)
@@ -496,4 +498,16 @@
         }
     }
 
+    public BattleField GetBattleFieldByMapID(int v)
+    {
+        foreach (var battleField in battleFields)
+        {
+            if (battleField.Value.MapID == v)
+            {
+                return battleField.Value;
+            }
+        }
+
+        return null;
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0