Layering for atmospheric pipes (#36124)
Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.NodeContainer.EntitySystems;
|
||||
using Content.Server.NodeContainer.NodeGroups;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Components;
|
||||
using Content.Shared.NodeContainer;
|
||||
using Content.Shared.NodeContainer.NodeGroups;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -12,7 +10,7 @@ namespace Content.Server.NodeContainer.Nodes
|
||||
{
|
||||
/// <summary>
|
||||
/// Connects with other <see cref="PipeNode"/>s whose <see cref="PipeDirection"/>
|
||||
/// correctly correspond.
|
||||
/// and <see cref="CurrentPipeLayer"/> correctly correspond.
|
||||
/// </summary>
|
||||
[DataDefinition]
|
||||
[Virtual]
|
||||
@@ -24,6 +22,12 @@ namespace Content.Server.NodeContainer.Nodes
|
||||
[DataField("pipeDirection")]
|
||||
public PipeDirection OriginalPipeDirection;
|
||||
|
||||
/// <summary>
|
||||
/// The *current* layer to which the pipe node is assigned.
|
||||
/// </summary>
|
||||
[DataField("pipeLayer")]
|
||||
public AtmosPipeLayer CurrentPipeLayer = AtmosPipeLayer.Primary;
|
||||
|
||||
/// <summary>
|
||||
/// The *current* pipe directions (accounting for rotation)
|
||||
/// Used to check if this pipe can connect to another pipe in a given direction.
|
||||
@@ -204,6 +208,7 @@ namespace Content.Server.NodeContainer.Nodes
|
||||
foreach (var pipe in PipesInDirection(pos, pipeDir, grid, nodeQuery))
|
||||
{
|
||||
if (pipe.NodeGroupID == NodeGroupID
|
||||
&& pipe.CurrentPipeLayer == CurrentPipeLayer
|
||||
&& pipe.CurrentPipeDirection.HasDirection(pipeDir.GetOpposite()))
|
||||
{
|
||||
yield return pipe;
|
||||
|
||||
Reference in New Issue
Block a user