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);
|
||||
}
|
||||
|
||||
@@ -3,29 +3,23 @@ using System;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.Explosions;
|
||||
using Content.Server.GameObjects.Components.Body.Respiratory;
|
||||
using Content.Server.GameObjects.Components.GUI;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.GameObjects.Components.Atmos.GasTank;
|
||||
using Content.Shared.GameObjects.Components.Inventory;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.Verbs;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Server.GameObjects.Components.UserInterface;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.EntitySystemMessages;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Atmos.Piping
|
||||
{
|
||||
@@ -32,11 +31,6 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping
|
||||
{
|
||||
var gridAtmos = EntitySystem.Get<AtmosphereSystem>()
|
||||
.GetGridAtmosphere(Owner.Transform.GridID);
|
||||
if (gridAtmos == null)
|
||||
{
|
||||
Logger.Error($"{nameof(PipeNetDeviceComponent)} on entity {Owner.Uid} could not find an {nameof(IGridAtmosphereComponent)}.");
|
||||
return;
|
||||
}
|
||||
JoinedGridAtmos = gridAtmos;
|
||||
JoinedGridAtmos.AddPipeNetDevice(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user