From c8123383d552ff4095eaf7a4d9ba7b2b756d70bf Mon Sep 17 00:00:00 2001 From: NotAlwaysTrue <2136846186@qq.com> Date: Tue, 23 Dec 2025 00:17:28 +0800 Subject: [PATCH] Add another try-catch to avoid Destination array was not long enough. Check the destination index, length, and the array's lower bounds issue --- .../SharedSource/Map/SubmarineBody.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineBody.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineBody.cs index 29254525c..ce8a8c320 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineBody.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineBody.cs @@ -1,5 +1,6 @@ using Barotrauma.Extensions; using Barotrauma.Items.Components; +using Barotrauma.Networking; using FarseerPhysics; using FarseerPhysics.Common; using FarseerPhysics.Dynamics; @@ -426,7 +427,17 @@ namespace Barotrauma if (points[0].Y > Body.SimPosition.Y && !Character.CharacterList.Any(c => c.Submarine == otherSubmarine && !c.IsIncapacitated && c.TeamID == otherSubmarine.TeamID)) { - otherSubmarine.GetConnectedSubs().ToList().ForEach(s => s.SubBody.forceUpwardsTimer += deltaTime); + try + { + otherSubmarine.GetConnectedSubs().ToList().ForEach(s => s.SubBody.forceUpwardsTimer += deltaTime); + } + catch + { +#if SERVER + GameServer.Log("Try making UniqueEvents snapshot failed", ServerLog.MessageType.Error); +#endif + } + break; } }