Gas tile overlay state handling changes (#12691)
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Linq;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.Reactions;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Components;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -48,6 +49,8 @@ public sealed partial class AtmosphereSystem
|
||||
if (!TryComp(uid, out MapGridComponent? mapGrid))
|
||||
return;
|
||||
|
||||
EnsureComp<GasTileOverlayComponent>(uid);
|
||||
|
||||
foreach (var (indices, tile) in gridAtmosphere.Tiles)
|
||||
{
|
||||
gridAtmosphere.InvalidatedCoords.Add(indices);
|
||||
@@ -550,12 +553,14 @@ public sealed partial class AtmosphereSystem
|
||||
|
||||
var uid = gridAtmosphere.Owner;
|
||||
|
||||
TryComp(gridAtmosphere.Owner, out GasTileOverlayComponent? overlay);
|
||||
|
||||
// Gotta do this afterwards so we can properly update adjacent tiles.
|
||||
foreach (var (position, _) in gridAtmosphere.Tiles.ToArray())
|
||||
{
|
||||
var ev = new UpdateAdjacentMethodEvent(uid, position);
|
||||
GridUpdateAdjacent(uid, gridAtmosphere, ref ev);
|
||||
InvalidateVisuals(mapGrid.Owner, position);
|
||||
InvalidateVisuals(mapGrid.Owner, position, overlay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user