Removes AtmosCooldown from TileAtmosphere, fixes various atmos issues (#2297)

* Remove AtmosCooldown

* Fix former space tiles always having an immutable gas mixture

* _tile -> _tiles
This commit is contained in:
Víctor Aguilera Puerto
2020-10-19 14:50:16 +02:00
committed by GitHub
parent 717a375abb
commit 19d32eb4ce
7 changed files with 39 additions and 37 deletions

View File

@@ -241,6 +241,12 @@ namespace Content.Server.GameObjects.Components.Atmos
FixVacuum(tile.GridIndices);
}
// Tile used to be space, but isn't anymore.
if (tile.Air?.Immutable ?? false)
{
tile.Air = null;
}
tile.Air ??= new GasMixture(GetVolumeForCells(1), AtmosphereSystem){Temperature = Atmospherics.T20C};
}
@@ -300,12 +306,15 @@ namespace Content.Server.GameObjects.Components.Atmos
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void RemoveActiveTile(TileAtmosphere? tile)
public virtual void RemoveActiveTile(TileAtmosphere? tile, bool disposeGroup = true)
{
if (tile == null) return;
_activeTiles.Remove(tile);
tile.Excited = false;
tile.ExcitedGroup?.Dispose();
if(disposeGroup)
tile.ExcitedGroup?.Dispose();
else
tile.ExcitedGroup?.RemoveTile(tile);
}
/// <inheritdoc />

View File

@@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.Components.Atmos
public override void AddActiveTile(TileAtmosphere? tile) { }
public override void RemoveActiveTile(TileAtmosphere? tile) { }
public override void RemoveActiveTile(TileAtmosphere? tile, bool disposeGroup = true) { }
public override void AddHotspotTile(TileAtmosphere? tile) { }

View File

@@ -26,7 +26,6 @@ namespace Content.Server.GameObjects.EntitySystems
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPauseManager _pauseManager = default!;
[Dependency] private IEntityManager _entityManager = default!;
private GasReactionPrototype[] _gasReactions = Array.Empty<GasReactionPrototype>();
@@ -38,11 +37,6 @@ namespace Content.Server.GameObjects.EntitySystems
/// </summary>
public IEnumerable<GasReactionPrototype> GasReactions => _gasReactions!;
/// <summary>
/// EventBus reference for gas reactions.
/// </summary>
public IEventBus EventBus => _entityManager.EventBus;
public GridTileLookupSystem GridTileLookupSystem => _gridTileLookup ??= Get<GridTileLookupSystem>();
public override void Initialize()