Piping Unit test fixes (#3471)
* PipeNetDevice on piping prototypes * client component ignore * NodeContainer OnRemove bugfix * Moves some NodeContainer code from OnRemove to Shutdown * yaml indentation fix
This commit is contained in:
@@ -152,6 +152,7 @@ namespace Content.Client
|
|||||||
"VolumePump",
|
"VolumePump",
|
||||||
"PressureSiphon",
|
"PressureSiphon",
|
||||||
"PipeHeater",
|
"PipeHeater",
|
||||||
|
"PipeNetDevice",
|
||||||
"SignalReceiver",
|
"SignalReceiver",
|
||||||
"SignalSwitch",
|
"SignalSwitch",
|
||||||
"SignalTransmitter",
|
"SignalTransmitter",
|
||||||
|
|||||||
@@ -60,13 +60,14 @@ namespace Content.Server.GameObjects.Components.NodeContainer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnRemove()
|
protected override void Shutdown()
|
||||||
{
|
{
|
||||||
|
base.Shutdown();
|
||||||
|
|
||||||
foreach (var node in _nodes)
|
foreach (var node in _nodes)
|
||||||
{
|
{
|
||||||
node.OnContainerRemove();
|
node.OnContainerShutdown();
|
||||||
}
|
}
|
||||||
base.OnRemove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AnchorUpdate()
|
private void AnchorUpdate()
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
{
|
{
|
||||||
protected override IEnumerable<Node> GetReachableNodes()
|
protected override IEnumerable<Node> GetReachableNodes()
|
||||||
{
|
{
|
||||||
var cells = Owner.GetComponent<SnapGridComponent>()
|
if (!Owner.TryGetComponent(out SnapGridComponent? grid))
|
||||||
.GetCardinalNeighborCells();
|
yield break;
|
||||||
|
|
||||||
|
var cells = grid.GetCardinalNeighborCells();
|
||||||
|
|
||||||
foreach (var cell in cells)
|
foreach (var cell in cells)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnContainerRemove()
|
public virtual void OnContainerShutdown()
|
||||||
{
|
{
|
||||||
_deleting = true;
|
_deleting = true;
|
||||||
NodeGroup.RemoveNode(this);
|
NodeGroup.RemoveNode(this);
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
UpdateAppearance();
|
UpdateAppearance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnContainerRemove()
|
public override void OnContainerShutdown()
|
||||||
{
|
{
|
||||||
base.OnContainerRemove();
|
base.OnContainerShutdown();
|
||||||
UpdateAdjacentConnectedDirections();
|
UpdateAdjacentConnectedDirections();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,8 +173,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private IEnumerable<PipeNode> PipesInDirection(PipeDirection pipeDir)
|
private IEnumerable<PipeNode> PipesInDirection(PipeDirection pipeDir)
|
||||||
{
|
{
|
||||||
var entities = Owner.GetComponent<SnapGridComponent>()
|
if (!Owner.TryGetComponent(out SnapGridComponent? grid))
|
||||||
.GetInDir(pipeDir.ToDirection());
|
yield break;
|
||||||
|
|
||||||
|
var entities = grid.GetInDir(pipeDir.ToDirection());
|
||||||
|
|
||||||
foreach (var entity in entities)
|
foreach (var entity in entities)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
- !type:DoActsBehavior
|
- !type:DoActsBehavior
|
||||||
acts: ["Destruction"]
|
acts: ["Destruction"]
|
||||||
- type: GasCanisterPort
|
- type: GasCanisterPort
|
||||||
|
- type: PipeNetDevice
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: GasCanisterPortBase
|
parent: GasCanisterPortBase
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
- type: PipeConnectorVisualizer
|
||||||
- type: GasFilterVisualizer
|
- type: GasFilterVisualizer
|
||||||
|
- type: PipeNetDevice
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: GasFilterBase
|
parent: GasFilterBase
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
offset: Center
|
||||||
- type: GasGenerator
|
- type: GasGenerator
|
||||||
|
- type: PipeNetDevice
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: GasGeneratorBase
|
parent: GasGeneratorBase
|
||||||
|
|||||||
@@ -30,4 +30,5 @@
|
|||||||
- !type:PipeNode
|
- !type:PipeNode
|
||||||
nodeGroupID: Pipe
|
nodeGroupID: Pipe
|
||||||
pipeDirection: East
|
pipeDirection: East
|
||||||
- type: PipeHeater
|
- type: PipeHeater
|
||||||
|
- type: PipeNetDevice
|
||||||
@@ -30,7 +30,8 @@
|
|||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
- type: PipeConnectorVisualizer
|
||||||
- type: PumpVisualizer
|
- type: PumpVisualizer
|
||||||
|
- type: PipeNetDevice
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: PumpBase
|
parent: PumpBase
|
||||||
id: DebugPressurePump
|
id: DebugPressurePump
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
- type: PipeConnectorVisualizer
|
||||||
- type: SiphonVisualizer
|
- type: SiphonVisualizer
|
||||||
|
- type: PipeNetDevice
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: ScrubberBase
|
parent: ScrubberBase
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
- type: PipeConnectorVisualizer
|
||||||
- type: VentVisualizer
|
- type: VentVisualizer
|
||||||
|
- type: PipeNetDevice
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: VentBase
|
parent: VentBase
|
||||||
|
|||||||
Reference in New Issue
Block a user