Actually fix NRE in atmos.
This commit is contained in:
@@ -236,7 +236,7 @@ namespace Content.Server.Atmos
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void EqualizePressureInZone(int cycleNum)
|
||||
{
|
||||
if (Air == null || (_tileAtmosInfo.LastCycle >= cycleNum)) return; // Already done.
|
||||
@@ -427,7 +427,7 @@ namespace Content.Server.Atmos
|
||||
if (!tile._adjacentBits.IsFlagSet(direction)) continue;
|
||||
var tile2 = tile._adjacentTiles[k];
|
||||
if (giver._tileAtmosInfo.MoleDelta <= 0) break; // We're done here now. Let's not do more work than needed.
|
||||
if (tile2._tileAtmosInfo.LastQueueCycle != queueCycle) continue;
|
||||
if (tile2 == null || tile2._tileAtmosInfo.LastQueueCycle != queueCycle) continue;
|
||||
if (tile2._tileAtmosInfo.LastSlowQueueCycle == queueCycleSlow) continue;
|
||||
|
||||
queue[queueLength++] = tile2;
|
||||
@@ -496,7 +496,7 @@ namespace Content.Server.Atmos
|
||||
var tile2 = tile._adjacentTiles[k];
|
||||
|
||||
if (taker._tileAtmosInfo.MoleDelta >= 0) break; // We're done here now. Let's not do more work than needed.
|
||||
if (tile2._tileAtmosInfo.LastQueueCycle != queueCycle) continue;
|
||||
if (tile2 == null || tile2._tileAtmosInfo.LastQueueCycle != queueCycle) continue;
|
||||
if (tile2._tileAtmosInfo.LastSlowQueueCycle == queueCycleSlow) continue;
|
||||
queue[queueLength++] = tile2;
|
||||
tile2._tileAtmosInfo.LastSlowQueueCycle = queueCycleSlow;
|
||||
|
||||
@@ -585,8 +585,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
while (_currentRunTiles.Count > 0)
|
||||
{
|
||||
var tile = _currentRunTiles.Dequeue();
|
||||
// ReSharper disable once ConstantConditionalAccessQualifier
|
||||
tile?.EqualizePressureInZone(UpdateCounter);
|
||||
tile.EqualizePressureInZone(UpdateCounter);
|
||||
|
||||
if (number++ < LagCheckIterations) continue;
|
||||
number = 0;
|
||||
|
||||
Reference in New Issue
Block a user