Add anchored checks to GetReachableNodes() for power device nodes (#5760)

This commit is contained in:
Caj Jones
2021-12-13 00:45:54 -05:00
committed by GitHub
parent f110e28021
commit 41a9bb1efa
3 changed files with 12 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Content.Server.NodeContainer.Nodes;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -12,6 +12,9 @@ namespace Content.Server.Power.Nodes
{
public override IEnumerable<Node> GetReachableNodes()
{
if (!Anchored)
yield break;
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).GridID == GridId.Invalid)
yield break; // No funny nodes in spess.