Some work

This commit is contained in:
Víctor Aguilera Puerto
2020-08-19 12:23:42 +02:00
parent 259762717b
commit 5190c04944
40 changed files with 586 additions and 52 deletions

View File

@@ -45,6 +45,12 @@ namespace Content.Server.Atmos
/// </summary>
void FixVacuum(MapIndices indices);
/// <summary>
/// Revalidates indices immediately.
/// </summary>
/// <param name="indices"></param>
void Revalidate(MapIndices indices);
/// <summary>
/// Adds an active tile so it becomes processed every update until it becomes inactive.
/// Also makes the tile excited.

View File

@@ -1051,6 +1051,25 @@ namespace Content.Server.Atmos
private void ConsiderFirelocks(TileAtmosphere other)
{
// TODO ATMOS firelocks!
var reconsiderAdjacent = false;
foreach (var entity in GridIndices.GetEntitiesInTile(GridIndex))
{
if (!entity.TryGetComponent(out FirelockComponent firelock)) continue;
reconsiderAdjacent |= firelock.EmergencyPressureStop();
}
foreach (var entity in other.GridIndices.GetEntitiesInTile(other.GridIndex))
{
if (!entity.TryGetComponent(out FirelockComponent firelock)) continue;
reconsiderAdjacent |= firelock.EmergencyPressureStop();
}
if (reconsiderAdjacent)
{
UpdateAdjacent();
other.UpdateAdjacent();
}
}
private void React()