Faction Test 100.10.0.0

This commit is contained in:
Markus Isberg
2022-12-07 17:46:02 +02:00
parent de250b4a64
commit e0c3754621
19 changed files with 147 additions and 62 deletions
@@ -652,8 +652,18 @@ namespace Barotrauma
if (ShouldApply(NetFlags.SubList, id, requireUpToDateSave: false))
{
foreach (int ownedSubIndex in ownedSubIndices)
foreach (ushort ownedSubIndex in ownedSubIndices)
{
if (ownedSubIndex >= GameMain.Client.ServerSubmarines.Count)
{
string errorMsg = $"Error in {nameof(MultiPlayerCampaign.ClientRead)}. Owned submarine index was out of bounds. Index: {ownedSubIndex}, submarines: {string.Join(", ", GameMain.Client.ServerSubmarines.Select(s => s.Name))}";
DebugConsole.ThrowError(errorMsg);
GameAnalyticsManager.AddErrorEventOnce(
"MultiPlayerCampaign.ClientRead.OwnerSubIndexOutOfBounds" + ownedSubIndex,
GameAnalyticsManager.ErrorSeverity.Error, errorMsg);
continue;
}
SubmarineInfo sub = GameMain.Client.ServerSubmarines[ownedSubIndex];
if (GameMain.NetLobbyScreen.CheckIfCampaignSubMatches(sub, NetLobbyScreen.SubmarineDeliveryData.Owned))
{