diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index e56b03ecbb..5839b7009c 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; using Content.Server.Atmos.Reactions; using Content.Server.GameObjects.Components.Atmos; -using Content.Server.GameObjects.EntitySystems.Atmos; using Content.Server.Interfaces; using Content.Server.Utility; using Content.Shared.Atmos; @@ -14,7 +13,6 @@ using JetBrains.Annotations; using Robust.Server.GameObjects.EntitySystems; using Robust.Server.GameObjects.EntitySystems.TileLookup; using Robust.Shared.Containers; -using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.GameObjects; diff --git a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs index 46897da16c..b14de38ccd 100644 --- a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using Content.Server.Atmos; @@ -264,7 +265,7 @@ namespace Content.Server.GameObjects.Components.Atmos var direction = (AtmosDirection) (1 << i); var otherIndices = indices.Offset(direction.ToDirection()); var otherTile = GetTile(otherIndices); - AddActiveTile(otherTile); + if (otherTile != null) AddActiveTile(otherTile); } } @@ -298,7 +299,7 @@ namespace Content.Server.GameObjects.Components.Atmos /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void AddActiveTile(TileAtmosphere? tile) + public virtual void AddActiveTile(TileAtmosphere tile) { if (tile?.GridIndex != _gridId) return; tile.Excited = true; @@ -307,9 +308,8 @@ namespace Content.Server.GameObjects.Components.Atmos /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void RemoveActiveTile(TileAtmosphere? tile, bool disposeGroup = true) + public virtual void RemoveActiveTile(TileAtmosphere tile, bool disposeGroup = true) { - if (tile == null) return; _activeTiles.Remove(tile); tile.Excited = false; if(disposeGroup) @@ -320,7 +320,7 @@ namespace Content.Server.GameObjects.Components.Atmos /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void AddHotspotTile(TileAtmosphere? tile) + public virtual void AddHotspotTile(TileAtmosphere tile) { if (tile?.GridIndex != _gridId || tile?.Air == null) return; _hotspotTiles.Add(tile); @@ -328,29 +328,27 @@ namespace Content.Server.GameObjects.Components.Atmos /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void RemoveHotspotTile(TileAtmosphere? tile) + public virtual void RemoveHotspotTile(TileAtmosphere tile) { - if (tile == null) return; _hotspotTiles.Remove(tile); } - public virtual void AddSuperconductivityTile(TileAtmosphere? tile) + public virtual void AddSuperconductivityTile(TileAtmosphere tile) { if (tile?.GridIndex != _gridId) return; _superconductivityTiles.Add(tile); } - public virtual void RemoveSuperconductivityTile(TileAtmosphere? tile) + public virtual void RemoveSuperconductivityTile(TileAtmosphere tile) { - if (tile == null) return; _superconductivityTiles.Remove(tile); } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void AddHighPressureDelta(TileAtmosphere? tile) + public virtual void AddHighPressureDelta(TileAtmosphere tile) { - if (tile?.GridIndex != _gridId) return; + if (tile.GridIndex != _gridId) return; _highPressureDelta.Add(tile); }