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:
DrSmugleaf
2020-12-08 12:17:13 +01:00
committed by GitHub
parent a78452c845
commit 074db878bb
6 changed files with 9 additions and 29 deletions

View File

@@ -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);
}