Files
Delta-v/Content.Shared/_DV/Medical/CrewMonitoring/LongRangeCrewMonitorSystem.cs
T
deltanedasanddeltanedas 7026fc7125 make LPO's crew monitor actually show people on the station (#4015)
* update code to allow long range crew monitor to work

* add syndicate crew monitor prototype

* update listening post to cull bloat and use new crew monitor

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2025-07-18 16:12:41 +01:00

26 lines
798 B
C#

using Content.Shared.Station.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
namespace Content.Shared._DV.Medical.CrewMonitoring;
public sealed class LongRangeCrewMonitorSystem : EntitySystem
{
/// <summary>
/// Finds an arbitrary station grid on the same map as the argument.
/// Returns null if no grid was found.
/// </summary>
public EntityUid? FindStationGridInMap(MapId map)
{
// also requiring MapGrid incase StationMember gets used for non-grids in the future
var query = EntityQueryEnumerator<StationMemberComponent, MapGridComponent>();
while (query.MoveNext(out var grid, out _, out _))
{
if (Transform(grid).MapID == map)
return grid;
}
return null;
}
}