Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Barotrauma.Extensions;
using Barotrauma.Networking;
@@ -273,8 +273,11 @@ namespace Barotrauma
for (int i = 0; i < amountToChoose; i++)
{
var traitor = viableTraitors.GetRandomUnsynced();
viableTraitors.Remove(traitor);
traitors.Add(traitor);
if (traitor != null)
{
viableTraitors.Remove(traitor);
traitors.Add(traitor);
}
}
return traitors;
}
@@ -388,7 +391,7 @@ namespace Barotrauma
{
if (level?.LevelData is { Type: LevelData.LevelType.LocationConnection })
{
if (Submarine.MainSub.WorldPosition.X > level.Size.X / 2)
if (Submarine.MainSub != null && Submarine.MainSub.WorldPosition.X > level.Size.X / 2)
{
//try starting ASAP if the submarine is already half-way through the level
//(brief delay regardless, because otherwise we might retry every frame if finding a suitable event fails below)