mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-15 03:31:44 +01:00
Properly dispose of stale pipedata chunks for the atmos monitor (#38974)
This commit is contained in:
@@ -279,6 +279,14 @@ public partial class AtmosphereSystem
|
||||
|
||||
public bool RemovePipeNet(Entity<GridAtmosphereComponent?> grid, PipeNet pipeNet)
|
||||
{
|
||||
// Technically this event can be fired even on grids that don't
|
||||
// actually have grid atmospheres.
|
||||
if (pipeNet.Grid is not null)
|
||||
{
|
||||
var ev = new PipeNodeGroupRemovedEvent(grid, pipeNet.NetId);
|
||||
RaiseLocalEvent(ref ev);
|
||||
}
|
||||
|
||||
return _atmosQuery.Resolve(grid, ref grid.Comp, false) && grid.Comp.PipeNets.Remove(pipeNet);
|
||||
}
|
||||
|
||||
@@ -329,3 +337,12 @@ public partial class AtmosphereSystem
|
||||
[ByRefEvent] private record struct IsHotspotActiveMethodEvent
|
||||
(EntityUid Grid, Vector2i Tile, bool Result = false, bool Handled = false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Raised broadcasted when a pipe node group within a grid has been removed.
|
||||
/// </summary>
|
||||
/// <param name="Grid">The grid with the removed node group.</param>
|
||||
/// <param name="NetId">The net id of the removed node group.</param>
|
||||
[ByRefEvent]
|
||||
public record struct PipeNodeGroupRemovedEvent(EntityUid Grid, int NetId);
|
||||
|
||||
Reference in New Issue
Block a user