Fix NetEntity DataField in AnalysisConsoleComponent (#39984)

* fix analysis console

* fix test

* totally not a web edit
This commit is contained in:
slarticodefast
2025-10-11 02:22:31 +02:00
committed by GitHub
parent bed5e8fd7a
commit bed556051b
4 changed files with 75 additions and 31 deletions

View File

@@ -214,6 +214,17 @@ public abstract class SharedDeviceLinkSystem : EntitySystem
return links;
}
/// <summary>
/// Gets the entities linked to a specific source port.
/// </summary>
public HashSet<EntityUid> GetLinkedSinks(Entity<DeviceLinkSourceComponent?> source, ProtoId<SourcePortPrototype> port)
{
if (!Resolve(source, ref source.Comp) || !source.Comp.Outputs.TryGetValue(port, out var linked))
return new HashSet<EntityUid>(); // not a source or not linked
return new HashSet<EntityUid>(linked); // clone to prevent modifying the original
}
/// <summary>
/// Returns the default links for the given list of source port prototypes
/// </summary>