Add another try-catch to avoid Destination array was not long enough. Check the destination index, length, and the array's lower bounds issue

This commit is contained in:
NotAlwaysTrue
2025-12-23 00:17:28 +08:00
parent bdd6c52e4e
commit c8123383d5

View File

@@ -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;
}
}