Remove 700 usages of Component.Owner (#21100)

This commit is contained in:
DrSmugleaf
2023-10-19 12:34:31 -07:00
committed by GitHub
parent 5825ffb95c
commit f560f88eb5
261 changed files with 2291 additions and 2036 deletions

View File

@@ -3,9 +3,7 @@ using Content.Client.UserInterface.Controls;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Components;
using JetBrains.Annotations;
using Content.Shared.Shuttles.Systems;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Collections;
@@ -13,7 +11,6 @@ using Robust.Shared.Input;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components;
using Robust.Shared.Utility;
@@ -57,6 +54,8 @@ public sealed class RadarControl : MapGridControl
/// </summary>
public Action<EntityCoordinates>? OnRadarClick;
private List<Entity<MapGridComponent>> _grids = new();
public RadarControl() : base(64f, 256f, 256f)
{
_transform = _entManager.System<SharedTransformSystem>();
@@ -198,9 +197,11 @@ public sealed class RadarControl : MapGridControl
var shown = new HashSet<EntityUid>();
_grids.Clear();
_mapManager.FindGridsIntersecting(xform.MapID, new Box2(pos - MaxRadarRangeVector, pos + MaxRadarRangeVector), ref _grids);
// Draw other grids... differently
foreach (var grid in _mapManager.FindGridsIntersecting(xform.MapID,
new Box2(pos - MaxRadarRangeVector, pos + MaxRadarRangeVector)))
foreach (var grid in _grids)
{
var gUid = grid.Owner;
if (gUid == ourGridId || !fixturesQuery.HasComponent(gUid))
@@ -240,7 +241,7 @@ public sealed class RadarControl : MapGridControl
(iff == null && IFFComponent.ShowIFFDefault ||
(iff.Flags & IFFFlags.HideLabel) == 0x0))
{
var gridBounds = grid.LocalAABB;
var gridBounds = grid.Comp.LocalAABB;
Label label;
if (!_iffControls.TryGetValue(gUid, out var control))