Portable Generator Rework (#19302)
This commit is contained in:
committed by
GitHub
parent
50828363fe
commit
bf16698efa
@@ -1,6 +1,6 @@
|
||||
using Content.Server.NodeContainer;
|
||||
using Content.Server.NodeContainer.EntitySystems;
|
||||
using Content.Server.NodeContainer.Nodes;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
namespace Content.Server.Power.Nodes
|
||||
@@ -12,6 +12,24 @@ namespace Content.Server.Power.Nodes
|
||||
[Virtual]
|
||||
public partial class CableDeviceNode : Node
|
||||
{
|
||||
/// <summary>
|
||||
/// If disabled, this cable device will never connect.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If you change this,
|
||||
/// you must manually call <see cref="NodeGroupSystem.QueueReflood"/> to update the node connections.
|
||||
/// </remarks>
|
||||
[DataField("enabled")]
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
public override bool Connectable(IEntityManager entMan, TransformComponent? xform = null)
|
||||
{
|
||||
if (!Enabled)
|
||||
return false;
|
||||
|
||||
return base.Connectable(entMan, xform);
|
||||
}
|
||||
|
||||
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
|
||||
EntityQuery<NodeContainerComponent> nodeQuery,
|
||||
EntityQuery<TransformComponent> xformQuery,
|
||||
|
||||
Reference in New Issue
Block a user