diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/MapEntity.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/MapEntity.cs index a5066076b..21cec0761 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/MapEntity.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/MapEntity.cs @@ -656,6 +656,11 @@ namespace Barotrauma List gapList = Gap.GapList.ToList(); // This should never break again... right? + + //update gaps in random order, because otherwise in rooms with multiple gaps + //the water/air will always tend to flow through the first gap in the list, + //which may lead to weird behavior like water draining down only through + //one gap in a room even if there are several int n = gapList.Count; while (n > 1) { @@ -685,11 +690,6 @@ namespace Barotrauma }); }, () => - //update gaps in random order, because otherwise in rooms with multiple gaps - //the water/air will always tend to flow through the first gap in the list, - //which may lead to weird behavior like water draining down only through - //one gap in a room even if there are several - // moved waterflow reset here to see if we can reduce at least some time { // PLEASE WORK diff --git a/Barotrauma/BarotraumaShared/SharedSource/SingleThreadWorker.cs b/Barotrauma/BarotraumaShared/SharedSource/SingleThreadWorker.cs index c16530aa8..d83ca9769 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/SingleThreadWorker.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/SingleThreadWorker.cs @@ -87,7 +87,7 @@ namespace Barotrauma { try { - action.Invoke(); + action?.Invoke(); } catch (Exception e) {