"Fix" aghost mass scanner (#9438)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.Shuttles.BUIStates;
|
||||
using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
@@ -24,13 +25,28 @@ public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
|
||||
protected override void UpdateState(RadarConsoleComponent component)
|
||||
{
|
||||
var xform = Transform(component.Owner);
|
||||
|
||||
var onGrid = xform.ParentUid == xform.GridUid;
|
||||
EntityCoordinates? coordinates = onGrid ? xform.Coordinates : null;
|
||||
Angle? angle = onGrid ? xform.LocalRotation : null;
|
||||
|
||||
// Use ourself I guess.
|
||||
if (TryComp<IntrinsicUIComponent>(component.Owner, out var intrinsic))
|
||||
{
|
||||
foreach (var uiKey in intrinsic.UIs)
|
||||
{
|
||||
if (uiKey.Key?.Equals(RadarConsoleUiKey.Key) == true)
|
||||
{
|
||||
coordinates = new EntityCoordinates(component.Owner, Vector2.Zero);
|
||||
angle = Angle.Zero;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var radarState = new RadarConsoleBoundInterfaceState(
|
||||
component.MaxRange,
|
||||
onGrid ? xform.Coordinates : null,
|
||||
onGrid ? xform.LocalRotation : null,
|
||||
coordinates,
|
||||
angle,
|
||||
new List<DockingInterfaceState>());
|
||||
|
||||
_uiSystem.GetUiOrNull(component.Owner, RadarConsoleUiKey.Key)?.SetState(radarState);
|
||||
|
||||
Reference in New Issue
Block a user