diff --git a/Content.Server/Atmos/GasMixture.cs b/Content.Server/Atmos/GasMixture.cs index 8ab8993d5d..bb21c9a1e2 100644 --- a/Content.Server/Atmos/GasMixture.cs +++ b/Content.Server/Atmos/GasMixture.cs @@ -11,7 +11,6 @@ using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.Serialization; using Robust.Shared.Maths; using Robust.Shared.Serialization; -using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Server.Atmos @@ -42,7 +41,7 @@ namespace Content.Server.Atmos public bool Immutable { get; private set; } [ViewVariables] - public float LastShare { get; private set; } = 0; + public float LastShare { get; private set; } [ViewVariables] public readonly Dictionary ReactionResults = new() @@ -148,7 +147,7 @@ namespace Content.Server.Atmos [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Merge(GasMixture giver) { - if (Immutable || giver == null) return; + if (Immutable) return; if (MathF.Abs(Temperature - giver.Temperature) > Atmospherics.MinimumTemperatureDeltaToConsider) { diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index cddb3ff5c2..828f5a1b72 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -1121,7 +1121,7 @@ namespace Content.Server.Atmos public bool AssumeAir(GasMixture giver) { - if (giver == null || Air == null) return false; + if (Air == null) return false; Air.Merge(giver); diff --git a/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs b/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs index f87212e0cc..0d05e63cc8 100644 --- a/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs @@ -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); } diff --git a/Content.Server/GameObjects/Components/Atmos/GasTankComponent.cs b/Content.Server/GameObjects/Components/Atmos/GasTankComponent.cs index 99bb553b3d..afb603b0b4 100644 --- a/Content.Server/GameObjects/Components/Atmos/GasTankComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GasTankComponent.cs @@ -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; diff --git a/Content.Server/GameObjects/Components/Atmos/Piping/PipeNetDeviceComponent.cs b/Content.Server/GameObjects/Components/Atmos/Piping/PipeNetDeviceComponent.cs index e9494d059d..3f41f36f37 100644 --- a/Content.Server/GameObjects/Components/Atmos/Piping/PipeNetDeviceComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/Piping/PipeNetDeviceComponent.cs @@ -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() .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); } diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index 3f1810deb4..78f6f46b77 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -106,7 +106,7 @@ namespace Content.Server.GameObjects.Components.Doors /// /// Whether something is currently using a welder on this so DoAfter isn't spammed. /// - private bool _beingWelded = false; + private bool _beingWelded; [ViewVariables(VVAccess.ReadWrite)] private bool _canCrush = true; @@ -346,13 +346,10 @@ namespace Content.Server.GameObjects.Components.Doors var gridAtmosphere = atmosphereSystem.GetGridAtmosphere(Owner.Transform.GridID); - if (gridAtmosphere == null) - return false; - var minMoles = float.MaxValue; var maxMoles = 0f; - foreach (var (direction, adjacent) in gridAtmosphere.GetAdjacentTiles(tileAtmos.GridIndices)) + foreach (var (_, adjacent) in gridAtmosphere.GetAdjacentTiles(tileAtmos.GridIndices)) { var moles = adjacent.Air.TotalMoles; if (moles < minMoles) @@ -376,10 +373,7 @@ namespace Content.Server.GameObjects.Components.Doors var gridAtmosphere = atmosphereSystem.GetGridAtmosphere(Owner.Transform.GridID); - if (gridAtmosphere == null) - return false; - - foreach (var (direction, adjacent) in gridAtmosphere.GetAdjacentTiles(tileAtmos.GridIndices)) + foreach (var (_, adjacent) in gridAtmosphere.GetAdjacentTiles(tileAtmos.GridIndices)) { if (adjacent.Hotspot.Valid) return true;