Support for non-fulltile firelocks!

This commit is contained in:
Víctor Aguilera Puerto
2020-08-30 15:00:40 +02:00
parent c137d1bc16
commit 52e98e29d7
5 changed files with 95 additions and 74 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Atmos;
using Content.Server.GameObjects.Components.Atmos.Piping;
using Content.Server.GameObjects.Components.NodeContainer.NodeGroups;
using Content.Shared.Atmos;
@@ -48,7 +49,7 @@ namespace Content.Server.Atmos
/// Revalidates indices immediately.
/// </summary>
/// <param name="indices"></param>
void Revalidate(MapIndices indices);
void UpdateAdjacentBits(MapIndices indices);
/// <summary>
/// Adds an active tile so it becomes processed every update until it becomes inactive.
@@ -117,6 +118,7 @@ namespace Content.Server.Atmos
/// Returns a tile.
/// </summary>
/// <param name="indices"></param>
/// <param name="createSpace"></param>
/// <returns></returns>
TileAtmosphere GetTile(MapIndices indices, bool createSpace = true);
@@ -124,17 +126,19 @@ namespace Content.Server.Atmos
/// Returns a tile.
/// </summary>
/// <param name="coordinates"></param>
/// <param name="createSpace"></param>
/// <returns></returns>
TileAtmosphere GetTile(GridCoordinates coordinates, bool createSpace = true);
/// <summary>
/// Returns if the tile in question is air-blocked.
/// This could be due to a wall, an airlock, etc.
/// Also see AirtightComponent.
/// <seealso cref="AirtightComponent"/>
/// </summary>
/// <param name="indices"></param>
/// <param name="direction"></param>
/// <returns></returns>
bool IsAirBlocked(MapIndices indices);
bool IsAirBlocked(MapIndices indices, AtmosDirection direction);
/// <summary>
/// Returns if the tile in question is space.

View File

@@ -1122,7 +1122,7 @@ namespace Content.Server.Atmos
_adjacentTiles[direction.ToIndex()] = adjacent;
adjacent?.UpdateAdjacent(direction.GetOpposite());
if (adjacent != null && !_gridAtmosphereComponent.IsAirBlocked(adjacent.GridIndices))
if (adjacent != null && !_gridAtmosphereComponent.IsAirBlocked(adjacent.GridIndices, direction.GetOpposite()))
{
_adjacentBits |= direction;
}