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",
|
||||
"PressureSiphon",
|
||||
"PipeHeater",
|
||||
"PipeNetDevice",
|
||||
"SignalReceiver",
|
||||
"SignalSwitch",
|
||||
"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)
|
||||
{
|
||||
node.OnContainerRemove();
|
||||
node.OnContainerShutdown();
|
||||
}
|
||||
base.OnRemove();
|
||||
}
|
||||
|
||||
private void AnchorUpdate()
|
||||
|
||||
@@ -11,8 +11,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
||||
{
|
||||
protected override IEnumerable<Node> GetReachableNodes()
|
||||
{
|
||||
var cells = Owner.GetComponent<SnapGridComponent>()
|
||||
.GetCardinalNeighborCells();
|
||||
if (!Owner.TryGetComponent(out SnapGridComponent? grid))
|
||||
yield break;
|
||||
|
||||
var cells = grid.GetCardinalNeighborCells();
|
||||
|
||||
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;
|
||||
NodeGroup.RemoveNode(this);
|
||||
|
||||
@@ -109,9 +109,9 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
||||
UpdateAppearance();
|
||||
}
|
||||
|
||||
public override void OnContainerRemove()
|
||||
public override void OnContainerShutdown()
|
||||
{
|
||||
base.OnContainerRemove();
|
||||
base.OnContainerShutdown();
|
||||
UpdateAdjacentConnectedDirections();
|
||||
}
|
||||
|
||||
@@ -173,8 +173,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
||||
/// </summary>
|
||||
private IEnumerable<PipeNode> PipesInDirection(PipeDirection pipeDir)
|
||||
{
|
||||
var entities = Owner.GetComponent<SnapGridComponent>()
|
||||
.GetInDir(pipeDir.ToDirection());
|
||||
if (!Owner.TryGetComponent(out SnapGridComponent? grid))
|
||||
yield break;
|
||||
|
||||
var entities = grid.GetInDir(pipeDir.ToDirection());
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
- !type:DoActsBehavior
|
||||
acts: ["Destruction"]
|
||||
- type: GasCanisterPort
|
||||
- type: PipeNetDevice
|
||||
|
||||
- type: entity
|
||||
parent: GasCanisterPortBase
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
visuals:
|
||||
- type: PipeConnectorVisualizer
|
||||
- type: GasFilterVisualizer
|
||||
- type: PipeNetDevice
|
||||
|
||||
- type: entity
|
||||
parent: GasFilterBase
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
- type: SnapGrid
|
||||
offset: Center
|
||||
- type: GasGenerator
|
||||
- type: PipeNetDevice
|
||||
|
||||
- type: entity
|
||||
parent: GasGeneratorBase
|
||||
|
||||
@@ -31,3 +31,4 @@
|
||||
nodeGroupID: Pipe
|
||||
pipeDirection: East
|
||||
- type: PipeHeater
|
||||
- type: PipeNetDevice
|
||||
@@ -30,6 +30,7 @@
|
||||
visuals:
|
||||
- type: PipeConnectorVisualizer
|
||||
- type: PumpVisualizer
|
||||
- type: PipeNetDevice
|
||||
|
||||
- type: entity
|
||||
parent: PumpBase
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
visuals:
|
||||
- type: PipeConnectorVisualizer
|
||||
- type: SiphonVisualizer
|
||||
- type: PipeNetDevice
|
||||
|
||||
- type: entity
|
||||
parent: ScrubberBase
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
visuals:
|
||||
- type: PipeConnectorVisualizer
|
||||
- type: VentVisualizer
|
||||
- type: PipeNetDevice
|
||||
|
||||
- type: entity
|
||||
parent: VentBase
|
||||
|
||||
Reference in New Issue
Block a user