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:
collinlunn
2021-03-02 11:58:19 -07:00
committed by GitHub
parent 91cea56a5a
commit 06f549d282
12 changed files with 25 additions and 12 deletions

View File

@@ -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)
{

View File

@@ -74,7 +74,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
}
}
public virtual void OnContainerRemove()
public virtual void OnContainerShutdown()
{
_deleting = true;
NodeGroup.RemoveNode(this);

View File

@@ -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)
{