Remove redundant null checks for atmos (#2703)
* Remove redundant null checks for atmos * Remove unnecessary nullability parameter from AtmosphereSystem.GetGridAtmosphere * Remove more nullability markers * Bring back null checks for gas tanks * Remove null checks from GasMixture.Merge and TileAtmosphere.AssumeAir Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,7 @@ using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.Transform;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -25,7 +26,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
[ViewVariables]
|
||||
private int _currentAirBlockedDirection;
|
||||
private bool _airBlocked = true;
|
||||
private bool _fixVacuum = false;
|
||||
private bool _fixVacuum;
|
||||
|
||||
[ViewVariables]
|
||||
private bool _rotateAirBlocked = true;
|
||||
@@ -141,7 +142,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
UpdatePosition(_lastPosition.Item1, _lastPosition.Item2);
|
||||
|
||||
if (_fixVacuum)
|
||||
_atmosphereSystem.GetGridAtmosphere(_lastPosition.Item1)?.FixVacuum(_lastPosition.Item2);
|
||||
_atmosphereSystem.GetGridAtmosphere(_lastPosition.Item1).FixVacuum(_lastPosition.Item2);
|
||||
}
|
||||
|
||||
private void OnTransformMove()
|
||||
@@ -165,8 +166,6 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
{
|
||||
var gridAtmos = _atmosphereSystem.GetGridAtmosphere(gridId);
|
||||
|
||||
if (gridAtmos == null) return;
|
||||
|
||||
gridAtmos.UpdateAdjacentBits(pos);
|
||||
gridAtmos.Invalidate(pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user