Node network bug (#9039)
This commit is contained in:
@@ -56,9 +56,6 @@ namespace Content.Server.NodeContainer.NodeGroups
|
||||
[ViewVariables]
|
||||
public bool Removed { get; set; } = false;
|
||||
|
||||
[ViewVariables]
|
||||
protected EntityUid GridId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Network ID of this group for client-side debug visualization of nodes.
|
||||
/// </summary>
|
||||
@@ -75,12 +72,6 @@ namespace Content.Server.NodeContainer.NodeGroups
|
||||
|
||||
public virtual void Initialize(Node sourceNode, IEntityManager? entMan = null)
|
||||
{
|
||||
// TODO: Can we get rid of this GridId?
|
||||
IoCManager.Resolve(ref entMan);
|
||||
|
||||
var xform = entMan.GetComponent<TransformComponent>(sourceNode.Owner);
|
||||
DebugTools.AssertNotNull(xform.GridUid);
|
||||
GridId = xform.GridUid!.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -22,13 +22,20 @@ namespace Content.Server.NodeContainer.NodeGroups
|
||||
|
||||
[ViewVariables] private AtmosphereSystem? _atmosphereSystem;
|
||||
|
||||
public EntityUid Grid => GridId;
|
||||
public EntityUid? Grid { get; private set; }
|
||||
|
||||
public override void Initialize(Node sourceNode, IEntityManager? entMan = null)
|
||||
{
|
||||
IoCManager.Resolve(ref entMan);
|
||||
|
||||
base.Initialize(sourceNode, entMan);
|
||||
|
||||
_atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||
Grid = entMan.GetComponent<TransformComponent>(sourceNode.Owner).GridUid;
|
||||
|
||||
if (Grid == null)
|
||||
Logger.Error($"Created a pipe network without an associated grid. Pipe networks currently need to be tied to a grid for amtos to work. Source entity: {entMan.ToPrettyString(sourceNode.Owner)}");
|
||||
|
||||
_atmosphereSystem = entMan.EntitySysManager.GetEntitySystem<AtmosphereSystem>();
|
||||
_atmosphereSystem.AddPipeNet(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user