From 3b3963083b00e0ed5377a93af74d4760cc3ede00 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:59:02 +1100 Subject: [PATCH] Replace GridEntityId with Owner (#12743) --- .../SpawnExplosion/ExplosionDebugOverlay.cs | 4 ++-- .../UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs | 6 ++--- .../UI/Tabs/AtmosTab/AddGasWindow.xaml.cs | 6 ++--- .../UI/Tabs/AtmosTab/FillGasWindow.xaml.cs | 6 ++--- .../AtmosTab/SetTemperatureWindow.xaml.cs | 6 ++--- .../UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs | 2 +- .../Atmos/Overlays/AtmosDebugOverlay.cs | 6 ++--- .../Atmos/Overlays/GasTileOverlay.cs | 4 ++-- Content.Client/Explosion/ExplosionOverlay.cs | 2 +- Content.Client/Fluids/PuddleOverlay.cs | 4 ++-- Content.Client/Maps/GridDraggingSystem.cs | 2 +- .../Movement/Systems/JetpackSystem.cs | 2 +- Content.Client/NPC/PathfindingSystem.cs | 22 ++++++++--------- .../NodeContainer/NodeVisualizationOverlay.cs | 6 ++--- Content.Client/Shuttles/UI/DockingControl.cs | 8 +++---- Content.Client/Shuttles/UI/RadarControl.cs | 24 +++++++++---------- .../Weapons/Melee/MeleeWeaponSystem.cs | 6 ++--- Content.IntegrationTests/PoolManager.cs | 2 +- Content.IntegrationTests/Tests/CargoTest.cs | 2 +- Content.IntegrationTests/Tests/EntityTest.cs | 4 ++-- .../Tests/Fluids/FluidSpillTest.cs | 4 ++-- .../Tests/Fluids/PuddleTest.cs | 2 +- .../Tests/GravityGridTest.cs | 6 ++--- .../Tests/PostMapInitTest.cs | 6 ++--- .../Tests/SaveLoadMapTest.cs | 8 +++---- .../Tests/SaveLoadSaveTest.cs | 2 +- Content.IntegrationTests/Tests/ShuttleTest.cs | 2 +- Content.MapRenderer/Painters/GridPainter.cs | 12 +++++----- Content.MapRenderer/Painters/MapPainter.cs | 8 +++---- Content.MapRenderer/Painters/TilePainter.cs | 2 +- Content.Server/AME/AMENodeGroup.cs | 2 +- .../Atmos/Commands/FillGasCommand.cs | 2 +- .../Commands/SetAtmosTemperatureCommand.cs | 2 +- .../Atmos/Commands/SetTemperatureCommand.cs | 4 ++-- .../Atmos/EntitySystems/AirtightSystem.cs | 4 ++-- .../EntitySystems/AtmosDebugOverlaySystem.cs | 4 ++-- .../AtmosphereSystem.Commands.cs | 6 ++--- .../AtmosphereSystem.GridAtmosphere.cs | 4 ++-- .../AtmosphereSystem.Monstermos.cs | 10 ++++---- .../AtmosphereSystem.Processing.cs | 6 ++--- .../Cargo/Systems/CargoSystem.Shuttle.cs | 2 +- Content.Server/Cargo/Systems/PricingSystem.cs | 2 +- Content.Server/Chunking/ChunkingSystem.cs | 6 ++--- .../Commands/FixRotationsCommand.cs | 4 ++-- .../Commands/TileReplaceCommand.cs | 2 +- .../Construction/Commands/TileWallsCommand.cs | 4 ++-- .../Decals/Commands/AddDecalCommand.cs | 2 +- .../EntitySystems/ExplosionGridTileFlood.cs | 4 ++-- .../EntitySystems/ExplosionSystem.Airtight.cs | 8 +++---- .../EntitySystems/ExplosionSystem.GridMap.cs | 4 ++-- .../ExplosionSystem.Processing.cs | 6 ++--- .../EntitySystems/ExplosionSystem.TileFill.cs | 14 +++++------ .../PuddleDebugDebugOverlaySystem.cs | 2 +- .../GameTicking/GameTicker.Spawning.cs | 8 +++---- .../NPC/Pathfinding/PathfindingSystem.Grid.cs | 4 ++-- .../NPC/Systems/NPCCombatSystem.Ranged.cs | 2 +- .../Physics/Controllers/ConveyorController.cs | 2 +- .../Physics/Controllers/MoverController.cs | 2 +- .../EntitySystems/ExtensionCableSystem.cs | 2 +- Content.Server/RCD/Systems/RCDSystem.cs | 4 ++-- .../Systems/RadiationSystem.Debug.cs | 2 +- .../Systems/RadiationSystem.GridCast.cs | 8 +++---- Content.Server/Salvage/SalvageRulerCommand.cs | 2 +- Content.Server/Salvage/SalvageSystem.cs | 2 +- .../Shuttles/Systems/DockingSystem.cs | 6 ++--- .../Systems/ShuttleSystem.EmergencyShuttle.cs | 2 +- .../Systems/ShuttleSystem.FasterThanLight.cs | 16 ++++++------- .../Shuttles/Systems/ThrusterSystem.cs | 6 ++--- .../Station/Systems/StationSystem.cs | 12 +++++----- .../StationEvents/Events/MeteorSwarm.cs | 2 +- .../Events/StationEventSystem.cs | 4 ++-- Content.Server/Tiles/FloorTileSystem.cs | 4 ++-- .../EntityCoordinatesExtensions.cs | 6 ++--- Content.Shared/Maps/TurfHelpers.cs | 2 +- .../MovementIgnoreGravityComponent.cs | 2 +- 75 files changed, 190 insertions(+), 190 deletions(-) diff --git a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs index e9327aca62..ca56e5bcaf 100644 --- a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs +++ b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs @@ -66,7 +66,7 @@ public sealed class ExplosionDebugOverlay : Overlay if (!_mapManager.TryGetGrid(gridId, out var grid)) continue; - var gridXform = xformQuery.GetComponent(grid.GridEntityId); + var gridXform = xformQuery.GetComponent(grid.Owner); var (_, _, matrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(xformQuery); gridBounds = invMatrix.TransformBox(args.WorldBounds).Enlarged(grid.TileSize * 2); DrawText(handle, gridBounds, matrix, tileSets, grid.TileSize); @@ -134,7 +134,7 @@ public sealed class ExplosionDebugOverlay : Overlay if (!_mapManager.TryGetGrid(gridId, out var grid)) continue; - var gridXform = xformQuery.GetComponent(grid.GridEntityId); + var gridXform = xformQuery.GetComponent(grid.Owner); var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(xformQuery); gridBounds = invWorldMatrix.TransformBox(args.WorldBounds).Enlarged(grid.TileSize * 2); handle.SetTransform(worldMatrix); diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs index 0d5b11890f..51ac027901 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs @@ -21,12 +21,12 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab protected override void EnteredTree() { - _data = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.GridEntityId != 0); + _data = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.Owner != 0); foreach (var grid in _data) { var player = IoCManager.Resolve().LocalPlayer?.ControlledEntity; var playerGrid = IoCManager.Resolve().GetComponentOrNull(player)?.GridUid; - GridOptions.AddItem($"{grid.GridEntityId} {(playerGrid == grid.GridEntityId ? " (Current)" : "")}"); + GridOptions.AddItem($"{grid.Owner} {(playerGrid == grid.Owner ? " (Current)" : "")}"); } GridOptions.OnItemSelected += eventArgs => GridOptions.SelectId(eventArgs.Id); @@ -38,7 +38,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab if (_data == null) return; var dataList = _data.ToList(); - var selectedGrid = dataList[GridOptions.SelectedId].GridEntityId; + var selectedGrid = dataList[GridOptions.SelectedId].Owner; IoCManager.Resolve().ExecuteCommand($"addatmos {selectedGrid}"); } } diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs index 913992b11a..92c34dfef8 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs @@ -25,12 +25,12 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab protected override void EnteredTree() { // Fill out grids - _gridData = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.GridEntityId != 0); + _gridData = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.Owner != 0); foreach (var grid in _gridData) { var player = IoCManager.Resolve().LocalPlayer?.ControlledEntity; var playerGrid = IoCManager.Resolve().GetComponentOrNull(player)?.GridUid; - GridOptions.AddItem($"{grid.GridEntityId} {(playerGrid == grid.GridEntityId ? " (Current)" : "")}"); + GridOptions.AddItem($"{grid.Owner} {(playerGrid == grid.Owner ? " (Current)" : "")}"); } GridOptions.OnItemSelected += eventArgs => GridOptions.SelectId(eventArgs.Id); @@ -53,7 +53,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab return; var gridList = _gridData.ToList(); - var gridIndex = gridList[GridOptions.SelectedId].GridEntityId; + var gridIndex = gridList[GridOptions.SelectedId].Owner; var gasList = _gasData.ToList(); var gasId = gasList[GasOptions.SelectedId].ID; diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs index ccc1a9955c..e9f5adac88 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs @@ -25,12 +25,12 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab protected override void EnteredTree() { // Fill out grids - _gridData = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.GridEntityId != 0); + _gridData = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.Owner != 0); foreach (var grid in _gridData) { var player = IoCManager.Resolve().LocalPlayer?.ControlledEntity; var playerGrid = IoCManager.Resolve().GetComponentOrNull(player)?.GridUid; - GridOptions.AddItem($"{grid.GridEntityId} {(playerGrid == grid.GridEntityId ? " (Current)" : "")}"); + GridOptions.AddItem($"{grid.Owner} {(playerGrid == grid.Owner ? " (Current)" : "")}"); } GridOptions.OnItemSelected += eventArgs => GridOptions.SelectId(eventArgs.Id); @@ -53,7 +53,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab return; var gridList = _gridData.ToList(); - var gridIndex = gridList[GridOptions.SelectedId].GridEntityId; + var gridIndex = gridList[GridOptions.SelectedId].Owner; var gasList = _gasData.ToList(); var gasId = gasList[GasOptions.SelectedId].ID; diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs index 274990b96e..028dccd014 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs @@ -21,12 +21,12 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab protected override void EnteredTree() { - _data = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.GridEntityId != 0); + _data = IoCManager.Resolve().GetAllGrids().Where(g => (int) g.Owner != 0); foreach (var grid in _data) { var player = IoCManager.Resolve().LocalPlayer?.ControlledEntity; var playerGrid = IoCManager.Resolve().GetComponentOrNull(player)?.GridUid; - GridOptions.AddItem($"{grid.GridEntityId} {(playerGrid == grid.GridEntityId ? " (Current)" : "")}"); + GridOptions.AddItem($"{grid.Owner} {(playerGrid == grid.Owner ? " (Current)" : "")}"); } GridOptions.OnItemSelected += eventArgs => GridOptions.SelectId(eventArgs.Id); @@ -38,7 +38,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab if (_data == null) return; var dataList = _data.ToList(); - var selectedGrid = dataList[GridOptions.SelectedId].GridEntityId; + var selectedGrid = dataList[GridOptions.SelectedId].Owner; IoCManager.Resolve() .ExecuteCommand($"settemp {TileXSpin.Value} {TileYSpin.Value} {selectedGrid} {TemperatureSpin.Value}"); } diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs index 1536ba6760..4f1dd4b895 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs @@ -43,7 +43,7 @@ public sealed partial class ObjectsTab : Control var entities = selection switch { ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem().Stations.ToList(), - ObjectsTabSelection.Grids => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), + ObjectsTabSelection.Grids => _entityManager.EntityQuery(true).Select(x => ((Component) x).Owner).ToList(), ObjectsTabSelection.Maps => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), _ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null) }; diff --git a/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs b/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs index fe49fc1d7a..fe6a42f706 100644 --- a/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs +++ b/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs @@ -42,8 +42,8 @@ namespace Content.Client.Atmos.Overlays foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds)) { - if (!_atmosDebugOverlaySystem.HasData(mapGrid.GridEntityId) || - !_entManager.TryGetComponent(mapGrid.GridEntityId, out var xform)) + if (!_atmosDebugOverlaySystem.HasData(mapGrid.Owner) || + !_entManager.TryGetComponent(mapGrid.Owner, out var xform)) continue; drawHandle.SetTransform(xform.WorldMatrix); @@ -52,7 +52,7 @@ namespace Content.Client.Atmos.Overlays { foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds)) { - var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.GridEntityId, tile.GridIndices); + var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.Owner, tile.GridIndices); if (dataMaybeNull != null) { var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull!; diff --git a/Content.Client/Atmos/Overlays/GasTileOverlay.cs b/Content.Client/Atmos/Overlays/GasTileOverlay.cs index ce1895342a..c7b06d4be2 100644 --- a/Content.Client/Atmos/Overlays/GasTileOverlay.cs +++ b/Content.Client/Atmos/Overlays/GasTileOverlay.cs @@ -142,8 +142,8 @@ namespace Content.Client.Atmos.Overlays foreach (var mapGrid in _mapManager.FindGridsIntersecting(args.MapId, args.WorldBounds)) { - if (!TileData.TryGetValue(mapGrid.GridEntityId, out var gridData) || - !xformQuery.TryGetComponent(mapGrid.GridEntityId, out var gridXform)) + if (!TileData.TryGetValue(mapGrid.Owner, out var gridData) || + !xformQuery.TryGetComponent(mapGrid.Owner, out var gridXform)) continue; var (_, _, worldMatrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(); diff --git a/Content.Client/Explosion/ExplosionOverlay.cs b/Content.Client/Explosion/ExplosionOverlay.cs index 630efa9be2..6eae8c07d0 100644 --- a/Content.Client/Explosion/ExplosionOverlay.cs +++ b/Content.Client/Explosion/ExplosionOverlay.cs @@ -54,7 +54,7 @@ public sealed class ExplosionOverlay : Overlay if (!_mapManager.TryGetGrid(gridId, out var grid)) continue; - var xform = xforms.GetComponent(grid.GridEntityId); + var xform = xforms.GetComponent(grid.Owner); var (_, _, worldMatrix, invWorldMatrix) = xform.GetWorldPositionRotationMatrixWithInv(xforms); gridBounds = invWorldMatrix.TransformBox(worldBounds).Enlarged(grid.TileSize * 2); diff --git a/Content.Client/Fluids/PuddleOverlay.cs b/Content.Client/Fluids/PuddleOverlay.cs index ed5a6be63b..5cee2ba3a3 100644 --- a/Content.Client/Fluids/PuddleOverlay.cs +++ b/Content.Client/Fluids/PuddleOverlay.cs @@ -59,7 +59,7 @@ public sealed class PuddleOverlay : Overlay gridBounds = invWorldMatrix.TransformBox(args.WorldBounds).Enlarged(mapGrid.TileSize * 2); drawHandle.SetTransform(worldMatrix); - foreach (var debugOverlayData in _debugOverlaySystem.GetData(mapGrid.GridEntityId)) + foreach (var debugOverlayData in _debugOverlaySystem.GetData(mapGrid.Owner)) { var centre = ((Vector2) debugOverlayData.Pos + 0.5f) * mapGrid.TileSize; @@ -91,7 +91,7 @@ public sealed class PuddleOverlay : Overlay var (_, _, matrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(xformQuery); var gridBounds = invMatrix.TransformBox(args.WorldBounds).Enlarged(mapGrid.TileSize * 2); - foreach (var debugOverlayData in _debugOverlaySystem.GetData(mapGrid.GridEntityId)) + foreach (var debugOverlayData in _debugOverlaySystem.GetData(mapGrid.Owner)) { var centre = ((Vector2) debugOverlayData.Pos + 0.5f) * mapGrid.TileSize; diff --git a/Content.Client/Maps/GridDraggingSystem.cs b/Content.Client/Maps/GridDraggingSystem.cs index 3ea4838d33..cac67f2081 100644 --- a/Content.Client/Maps/GridDraggingSystem.cs +++ b/Content.Client/Maps/GridDraggingSystem.cs @@ -100,7 +100,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem if (!_mapManager.TryFindGridAt(mousePos, out var grid)) return; - StartDragging(grid.GridEntityId, Transform(grid.GridEntityId).InvWorldMatrix.Transform(mousePos.Position)); + StartDragging(grid.Owner, Transform(grid.Owner).InvWorldMatrix.Transform(mousePos.Position)); } if (!TryComp(_dragging, out var xform)) diff --git a/Content.Client/Movement/Systems/JetpackSystem.cs b/Content.Client/Movement/Systems/JetpackSystem.cs index 5e8794d116..637de44e09 100644 --- a/Content.Client/Movement/Systems/JetpackSystem.cs +++ b/Content.Client/Movement/Systems/JetpackSystem.cs @@ -69,7 +69,7 @@ public sealed class JetpackSystem : SharedJetpackSystem if (_mapManager.TryGetGrid(gridUid, out var grid)) { - coordinates = new EntityCoordinates(grid.GridEntityId, grid.WorldToLocal(coordinates.ToMapPos(EntityManager))); + coordinates = new EntityCoordinates(grid.Owner, grid.WorldToLocal(coordinates.ToMapPos(EntityManager))); } else if (uidXform.MapUid != null) { diff --git a/Content.Client/NPC/PathfindingSystem.cs b/Content.Client/NPC/PathfindingSystem.cs index 5b3847691e..bacf2d250f 100644 --- a/Content.Client/NPC/PathfindingSystem.cs +++ b/Content.Client/NPC/PathfindingSystem.cs @@ -173,7 +173,7 @@ namespace Content.Client.NPC foreach (var grid in _mapManager.FindGridsIntersecting(mouseWorldPos.MapId, aabb)) { - if (found || !_system.Breadcrumbs.TryGetValue(grid.GridEntityId, out var crumbs) || !xformQuery.TryGetComponent(grid.GridEntityId, out var gridXform)) + if (found || !_system.Breadcrumbs.TryGetValue(grid.Owner, out var crumbs) || !xformQuery.TryGetComponent(grid.Owner, out var gridXform)) continue; var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(); @@ -243,12 +243,12 @@ namespace Content.Client.NPC if ((_system.Modes & PathfindingDebugMode.Poly) != 0x0 && mouseWorldPos.MapId == args.MapId) { - if (!_mapManager.TryFindGridAt(mouseWorldPos, out var grid) || !xformQuery.TryGetComponent(grid.GridEntityId, out var gridXform)) + if (!_mapManager.TryFindGridAt(mouseWorldPos, out var grid) || !xformQuery.TryGetComponent(grid.Owner, out var gridXform)) return; var found = false; - if (!_system.Polys.TryGetValue(grid.GridEntityId, out var data)) + if (!_system.Polys.TryGetValue(grid.Owner, out var data)) return; var tileRef = grid.GetTileRef(mouseWorldPos); @@ -324,8 +324,8 @@ namespace Content.Client.NPC { foreach (var grid in _mapManager.FindGridsIntersecting(mouseWorldPos.MapId, aabb)) { - if (!_system.Breadcrumbs.TryGetValue(grid.GridEntityId, out var crumbs) || - !xformQuery.TryGetComponent(grid.GridEntityId, out var gridXform)) + if (!_system.Breadcrumbs.TryGetValue(grid.Owner, out var crumbs) || + !xformQuery.TryGetComponent(grid.Owner, out var gridXform)) continue; var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(); @@ -378,8 +378,8 @@ namespace Content.Client.NPC { foreach (var grid in _mapManager.FindGridsIntersecting(args.MapId, aabb)) { - if (!_system.Polys.TryGetValue(grid.GridEntityId, out var data) || - !xformQuery.TryGetComponent(grid.GridEntityId, out var gridXform)) + if (!_system.Polys.TryGetValue(grid.Owner, out var data) || + !xformQuery.TryGetComponent(grid.Owner, out var gridXform)) continue; var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(); @@ -412,8 +412,8 @@ namespace Content.Client.NPC { foreach (var grid in _mapManager.FindGridsIntersecting(args.MapId, aabb)) { - if (!_system.Polys.TryGetValue(grid.GridEntityId, out var data) || - !xformQuery.TryGetComponent(grid.GridEntityId, out var gridXform)) + if (!_system.Polys.TryGetValue(grid.Owner, out var data) || + !xformQuery.TryGetComponent(grid.Owner, out var gridXform)) continue; var (_, _, worldMatrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(); @@ -466,8 +466,8 @@ namespace Content.Client.NPC { foreach (var grid in _mapManager.FindGridsIntersecting(args.MapId, args.WorldBounds)) { - if (!_system.Breadcrumbs.TryGetValue(grid.GridEntityId, out var crumbs) || - !xformQuery.TryGetComponent(grid.GridEntityId, out var gridXform)) + if (!_system.Breadcrumbs.TryGetValue(grid.Owner, out var crumbs) || + !xformQuery.TryGetComponent(grid.Owner, out var gridXform)) continue; var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(); diff --git a/Content.Client/NodeContainer/NodeVisualizationOverlay.cs b/Content.Client/NodeContainer/NodeVisualizationOverlay.cs index 9ca30ad2c3..2086995c03 100644 --- a/Content.Client/NodeContainer/NodeVisualizationOverlay.cs +++ b/Content.Client/NodeContainer/NodeVisualizationOverlay.cs @@ -113,12 +113,12 @@ namespace Content.Client.NodeContainer foreach (var grid in _mapManager.FindGridsIntersecting(map, worldAABB)) { - foreach (var entity in _lookup.GetEntitiesIntersecting(grid.GridEntityId, worldAABB)) + foreach (var entity in _lookup.GetEntitiesIntersecting(grid.Owner, worldAABB)) { if (!_system.Entities.TryGetValue(entity, out var nodeData)) continue; - var gridDict = _gridIndex.GetOrNew(grid.GridEntityId); + var gridDict = _gridIndex.GetOrNew(grid.Owner); var coords = xformQuery.GetComponent(entity).Coordinates; // TODO: This probably shouldn't be capable of returning NaN... @@ -140,7 +140,7 @@ namespace Content.Client.NodeContainer foreach (var (gridId, gridDict) in _gridIndex) { var grid = _mapManager.GetGrid(gridId); - var (_, _, worldMatrix, invMatrix) = _entityManager.GetComponent(grid.GridEntityId).GetWorldPositionRotationMatrixWithInv(); + var (_, _, worldMatrix, invMatrix) = _entityManager.GetComponent(grid.Owner).GetWorldPositionRotationMatrixWithInv(); var lCursorBox = invMatrix.TransformBox(cursorBox); foreach (var (pos, list) in gridDict) diff --git a/Content.Client/Shuttles/UI/DockingControl.cs b/Content.Client/Shuttles/UI/DockingControl.cs index 95e45d786e..c4ba06d17c 100644 --- a/Content.Client/Shuttles/UI/DockingControl.cs +++ b/Content.Client/Shuttles/UI/DockingControl.cs @@ -141,14 +141,14 @@ public class DockingControl : Control foreach (var grid in _mapManager.FindGridsIntersecting(gridXform.MapID, new Box2(worldPos - _range, worldPos + _range))) { - if (grid.GridEntityId == GridEntity) + if (grid.Owner == GridEntity) continue; // Draw the fixtures before drawing any docks in range. - if (!_entManager.TryGetComponent(grid.GridEntityId, out var gridFixtures)) + if (!_entManager.TryGetComponent(grid.Owner, out var gridFixtures)) continue; - var gridMatrix = xformQuery.GetComponent(grid.GridEntityId).WorldMatrix; + var gridMatrix = xformQuery.GetComponent(grid.Owner).WorldMatrix; Matrix3.Multiply(in gridMatrix, in invMatrix, out var matty); @@ -195,7 +195,7 @@ public class DockingControl : Control } // Draw any docks on that grid - if (Docks.TryGetValue(grid.GridEntityId, out var gridDocks)) + if (Docks.TryGetValue(grid.Owner, out var gridDocks)) { foreach (var dock in gridDocks) { diff --git a/Content.Client/Shuttles/UI/RadarControl.cs b/Content.Client/Shuttles/UI/RadarControl.cs index 08e8ec4a74..ccf18990a1 100644 --- a/Content.Client/Shuttles/UI/RadarControl.cs +++ b/Content.Client/Shuttles/UI/RadarControl.cs @@ -202,17 +202,17 @@ public sealed class RadarControl : Control foreach (var grid in _mapManager.FindGridsIntersecting(mapPosition.MapId, new Box2(mapPosition.Position - MaxRadarRange, mapPosition.Position + MaxRadarRange))) { - if (grid.GridEntityId == ourGridId) + if (grid.Owner == ourGridId) continue; - var gridBody = bodyQuery.GetComponent(grid.GridEntityId); + var gridBody = bodyQuery.GetComponent(grid.Owner); if (gridBody.Mass < 10f) { - ClearLabel(grid.GridEntityId); + ClearLabel(grid.Owner); continue; } - _entManager.TryGetComponent(grid.GridEntityId, out var iff); + _entManager.TryGetComponent(grid.Owner, out var iff); // Hide it entirely. if (iff != null && @@ -221,14 +221,14 @@ public sealed class RadarControl : Control continue; } - shown.Add(grid.GridEntityId); - var name = metaQuery.GetComponent(grid.GridEntityId).EntityName; + shown.Add(grid.Owner); + var name = metaQuery.GetComponent(grid.Owner).EntityName; if (name == string.Empty) name = Loc.GetString("shuttle-console-unknown"); - var gridXform = xformQuery.GetComponent(grid.GridEntityId); - var gridFixtures = fixturesQuery.GetComponent(grid.GridEntityId); + var gridXform = xformQuery.GetComponent(grid.Owner); + var gridFixtures = fixturesQuery.GetComponent(grid.Owner); var gridMatrix = gridXform.WorldMatrix; Matrix3.Multiply(in gridMatrix, in offsetMatrix, out var matty); var color = iff?.Color ?? IFFComponent.IFFColor; @@ -240,14 +240,14 @@ public sealed class RadarControl : Control var gridBounds = grid.LocalAABB; Label label; - if (!_iffControls.TryGetValue(grid.GridEntityId, out var control)) + if (!_iffControls.TryGetValue(grid.Owner, out var control)) { label = new Label() { HorizontalAlignment = HAlignment.Left, }; - _iffControls[grid.GridEntityId] = label; + _iffControls[grid.Owner] = label; AddChild(label); } else @@ -277,13 +277,13 @@ public sealed class RadarControl : Control } else { - ClearLabel(grid.GridEntityId); + ClearLabel(grid.Owner); } // Detailed view DrawGrid(handle, matty, gridFixtures, color); - DrawDocks(handle, grid.GridEntityId, matty); + DrawDocks(handle, grid.Owner, matty); } foreach (var (ent, _) in _iffControls) diff --git a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs index bb7bfaa51d..90946d293c 100644 --- a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs @@ -103,7 +103,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem if (MapManager.TryFindGridAt(mousePos, out var grid)) { - coordinates = EntityCoordinates.FromMap(grid.GridEntityId, mousePos, EntityManager); + coordinates = EntityCoordinates.FromMap(grid.Owner, mousePos, EntityManager); } else { @@ -138,7 +138,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem // ReSharper disable once ConvertIfStatementToConditionalTernaryExpression if (MapManager.TryFindGridAt(mousePos, out var grid)) { - coordinates = EntityCoordinates.FromMap(grid.GridEntityId, mousePos, EntityManager); + coordinates = EntityCoordinates.FromMap(grid.Owner, mousePos, EntityManager); } else { @@ -179,7 +179,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem // ReSharper disable once ConvertIfStatementToConditionalTernaryExpression if (MapManager.TryFindGridAt(mousePos, out var grid)) { - coordinates = EntityCoordinates.FromMap(grid.GridEntityId, mousePos, EntityManager); + coordinates = EntityCoordinates.FromMap(grid.Owner, mousePos, EntityManager); } else { diff --git a/Content.IntegrationTests/PoolManager.cs b/Content.IntegrationTests/PoolManager.cs index ea62153bd0..e6bbc5784d 100644 --- a/Content.IntegrationTests/PoolManager.cs +++ b/Content.IntegrationTests/PoolManager.cs @@ -532,7 +532,7 @@ we are just going to end this here to save a lot of time. This is the exception var mapManager = IoCManager.Resolve(); mapData.MapId = mapManager.CreateMap(); mapData.MapGrid = mapManager.CreateGrid(mapData.MapId); - mapData.GridCoords = new EntityCoordinates(mapData.MapGrid.GridEntityId, 0, 0); + mapData.GridCoords = new EntityCoordinates(mapData.MapGrid.Owner, 0, 0); var tileDefinitionManager = IoCManager.Resolve(); var plating = tileDefinitionManager["Plating"]; var platingTile = new Tile(plating.TileId); diff --git a/Content.IntegrationTests/Tests/CargoTest.cs b/Content.IntegrationTests/Tests/CargoTest.cs index 027e7fc568..cfedd3f9ef 100644 --- a/Content.IntegrationTests/Tests/CargoTest.cs +++ b/Content.IntegrationTests/Tests/CargoTest.cs @@ -58,7 +58,7 @@ public sealed class CargoTest { var mapId = mapManager.CreateMap(); var grid = mapManager.CreateGrid(mapId); - var coord = new EntityCoordinates(grid.GridEntityId, 0, 0); + var coord = new EntityCoordinates(grid.Owner, 0, 0); var protoIds = protoManager.EnumeratePrototypes() .Where(p=>!p.Abstract) diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs index 5ca88a790c..b0db5461cc 100644 --- a/Content.IntegrationTests/Tests/EntityTest.cs +++ b/Content.IntegrationTests/Tests/EntityTest.cs @@ -41,7 +41,7 @@ namespace Content.IntegrationTests.Tests { var mapId = mapManager.CreateMap(); var grid = mapManager.CreateGrid(mapId); - var coord = new EntityCoordinates(grid.GridEntityId, 0, 0); + var coord = new EntityCoordinates(grid.Owner, 0, 0); entityMan.SpawnEntity(protoId, coord); } }); @@ -83,7 +83,7 @@ namespace Content.IntegrationTests.Tests .ToList(); var mapId = mapManager.CreateMap(); var grid = mapManager.CreateGrid(mapId); - var coord = new EntityCoordinates(grid.GridEntityId, 0, 0); + var coord = new EntityCoordinates(grid.Owner, 0, 0); foreach (var protoId in protoIds) { entityMan.SpawnEntity(protoId, coord); diff --git a/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs b/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs index afa8c9c2e6..b55febd839 100644 --- a/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs +++ b/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs @@ -58,7 +58,7 @@ public sealed class FluidSpill { mapId = mapManager.CreateMap(); var grid = mapManager.CreateGrid(mapId); - gridId = grid.GridEntityId; + gridId = grid.Owner; for (var x = 0; x < 3; x++) { @@ -125,7 +125,7 @@ public sealed class FluidSpill { mapId = mapManager.CreateMap(); var grid = mapManager.CreateGrid(mapId); - gridId = grid.GridEntityId; + gridId = grid.Owner; for (var x = 0; x < 3; x++) { diff --git a/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs b/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs index 658da4796b..30f4cd9020 100644 --- a/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs +++ b/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs @@ -104,7 +104,7 @@ namespace Content.IntegrationTests.Tests.Fluids sMapId = sMapManager.CreateMap(); sMapManager.SetMapPaused(sMapId, true); sGrid = sMapManager.CreateGrid(sMapId); - sGridId = sGrid.GridEntityId; + sGridId = sGrid.Owner; metaSystem.SetEntityPaused(sGridId, true); // See https://github.com/space-wizards/RobustToolbox/issues/1444 var tileDefinition = sTileDefinitionManager["UnderPlating"]; diff --git a/Content.IntegrationTests/Tests/GravityGridTest.cs b/Content.IntegrationTests/Tests/GravityGridTest.cs index b0434d9db6..d4634af6f8 100644 --- a/Content.IntegrationTests/Tests/GravityGridTest.cs +++ b/Content.IntegrationTests/Tests/GravityGridTest.cs @@ -68,8 +68,8 @@ namespace Content.IntegrationTests.Tests Assert.That(generatorComponent.GravityActive, Is.True); - var grid1Entity = grid1.GridEntityId; - var grid2Entity = grid2.GridEntityId; + var grid1Entity = grid1.Owner; + var grid2Entity = grid2.Owner; Assert.That(!entityMan.GetComponent(grid1Entity).EnabledVV); Assert.That(entityMan.GetComponent(grid2Entity).EnabledVV); @@ -87,7 +87,7 @@ namespace Content.IntegrationTests.Tests Assert.That(generatorComponent.GravityActive, Is.False); - var grid2Entity = grid2.GridEntityId; + var grid2Entity = grid2.Owner; Assert.That(entityMan.GetComponent(grid2Entity).EnabledVV, Is.False); }); diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs index e674868df3..13c3a1395a 100644 --- a/Content.IntegrationTests/Tests/PostMapInitTest.cs +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -202,11 +202,11 @@ namespace Content.IntegrationTests.Tests var memberQuery = entManager.GetEntityQuery(); var grids = mapManager.GetAllMapGrids(mapId).ToList(); - var gridUids = grids.Select(o => o.GridEntityId).ToList(); + var gridUids = grids.Select(o => o.Owner).ToList(); foreach (var grid in grids) { - if (!memberQuery.HasComponent(grid.GridEntityId)) + if (!memberQuery.HasComponent(grid.Owner)) continue; var area = grid.LocalAABB.Width * grid.LocalAABB.Height; @@ -214,7 +214,7 @@ namespace Content.IntegrationTests.Tests if (area > largest) { largest = area; - targetGrid = grid.GridEntityId; + targetGrid = grid.Owner; } } diff --git a/Content.IntegrationTests/Tests/SaveLoadMapTest.cs b/Content.IntegrationTests/Tests/SaveLoadMapTest.cs index aebdf7a037..90beefcd53 100644 --- a/Content.IntegrationTests/Tests/SaveLoadMapTest.cs +++ b/Content.IntegrationTests/Tests/SaveLoadMapTest.cs @@ -35,13 +35,13 @@ namespace Content.IntegrationTests.Tests { var mapGrid = mapManager.CreateGrid(mapId); - var mapGridEnt = mapGrid.GridEntityId; + var mapGridEnt = mapGrid.Owner; sEntities.GetComponent(mapGridEnt).WorldPosition = new Vector2(10, 10); mapGrid.SetTile(new Vector2i(0,0), new Tile(1, (TileRenderFlag)1, 255)); } { var mapGrid = mapManager.CreateGrid(mapId); - var mapGridEnt = mapGrid.GridEntityId; + var mapGridEnt = mapGrid.Owner; sEntities.GetComponent(mapGridEnt).WorldPosition = new Vector2(-8, -8); mapGrid.SetTile(new Vector2i(0, 0), new Tile(2, (TileRenderFlag)1, 254)); } @@ -61,7 +61,7 @@ namespace Content.IntegrationTests.Tests { { if (!mapManager.TryFindGridAt(new MapId(10), new Vector2(10, 10), out var mapGrid) || - !sEntities.TryGetComponent(mapGrid.GridEntityId, out var gridXform)) + !sEntities.TryGetComponent(mapGrid.Owner, out var gridXform)) { Assert.Fail(); return; @@ -73,7 +73,7 @@ namespace Content.IntegrationTests.Tests } { if (!mapManager.TryFindGridAt(new MapId(10), new Vector2(-8, -8), out var mapGrid) || - !sEntities.TryGetComponent(mapGrid.GridEntityId, out var gridXform)) + !sEntities.TryGetComponent(mapGrid.Owner, out var gridXform)) { Assert.Fail(); return; diff --git a/Content.IntegrationTests/Tests/SaveLoadSaveTest.cs b/Content.IntegrationTests/Tests/SaveLoadSaveTest.cs index 8280d92347..85b95ef117 100644 --- a/Content.IntegrationTests/Tests/SaveLoadSaveTest.cs +++ b/Content.IntegrationTests/Tests/SaveLoadSaveTest.cs @@ -31,7 +31,7 @@ namespace Content.IntegrationTests.Tests var mapId0 = mapManager.CreateMap(); // TODO: Properly find the "main" station grid. var grid0 = mapManager.CreateGrid(mapId0); - mapLoader.Save(grid0.GridEntityId, "save load save 1.yml"); + mapLoader.Save(grid0.Owner, "save load save 1.yml"); var mapId1 = mapManager.CreateMap(); var grid1 = mapLoader.LoadGrid(mapId1, "save load save 1.yml", new MapLoadOptions() {LoadMap = false}); mapLoader.Save(grid1!.Value, "save load save 2.yml"); diff --git a/Content.IntegrationTests/Tests/ShuttleTest.cs b/Content.IntegrationTests/Tests/ShuttleTest.cs index 333a3bf4d6..72aefd60fe 100644 --- a/Content.IntegrationTests/Tests/ShuttleTest.cs +++ b/Content.IntegrationTests/Tests/ShuttleTest.cs @@ -28,7 +28,7 @@ namespace Content.IntegrationTests.Tests { var mapId = mapMan.CreateMap(); var grid = mapMan.CreateGrid(mapId); - gridEnt = grid.GridEntityId; + gridEnt = grid.Owner; Assert.That(sEntities.HasComponent(gridEnt)); Assert.That(sEntities.TryGetComponent(gridEnt, out var physicsComponent)); diff --git a/Content.MapRenderer/Painters/GridPainter.cs b/Content.MapRenderer/Painters/GridPainter.cs index 7a3905ad2a..fffe3c160c 100644 --- a/Content.MapRenderer/Painters/GridPainter.cs +++ b/Content.MapRenderer/Painters/GridPainter.cs @@ -49,19 +49,19 @@ namespace Content.MapRenderer.Painters var stopwatch = new Stopwatch(); stopwatch.Start(); - if (!_entities.TryGetValue(grid.GridEntityId, out var entities)) + if (!_entities.TryGetValue(grid.Owner, out var entities)) { - Console.WriteLine($"No entities found on grid {grid.GridEntityId}"); + Console.WriteLine($"No entities found on grid {grid.Owner}"); return; } // Decals are always painted before entities, and are also optional. - if (_decals.TryGetValue(grid.GridEntityId, out var decals)) + if (_decals.TryGetValue(grid.Owner, out var decals)) _decalPainter.Run(gridCanvas, decals); _entityPainter.Run(gridCanvas, entities); - Console.WriteLine($"{nameof(GridPainter)} painted grid {grid.GridEntityId} in {(int) stopwatch.Elapsed.TotalMilliseconds} ms"); + Console.WriteLine($"{nameof(GridPainter)} painted grid {grid.Owner} in {(int) stopwatch.Elapsed.TotalMilliseconds} ms"); } private ConcurrentDictionary> GetEntities() @@ -120,14 +120,14 @@ namespace Content.MapRenderer.Painters // actually has the correct z-indices for decals for some reason when the server doesn't, // BUT can't do that yet because the client hasn't actually received everything yet // for some reason decal moment i guess. - if (_sEntityManager.TryGetComponent(grid.GridEntityId, out var comp)) + if (_sEntityManager.TryGetComponent(grid.Owner, out var comp)) { foreach (var (_, list) in comp.ChunkCollection.ChunkCollection) { foreach (var (_, decal) in list) { var (x, y) = TransformLocalPosition(decal.Coordinates, grid); - decals.GetOrNew(grid.GridEntityId).Add(new DecalData(decal, x, y)); + decals.GetOrNew(grid.Owner).Add(new DecalData(decal, x, y)); } } } diff --git a/Content.MapRenderer/Painters/MapPainter.cs b/Content.MapRenderer/Painters/MapPainter.cs index 84383f9551..5d4b19f72e 100644 --- a/Content.MapRenderer/Painters/MapPainter.cs +++ b/Content.MapRenderer/Painters/MapPainter.cs @@ -77,7 +77,7 @@ namespace Content.MapRenderer.Painters foreach (var grid in grids) { - var gridXform = xformQuery.GetComponent(grid.GridEntityId); + var gridXform = xformQuery.GetComponent(grid.Owner); gridXform.WorldRotation = Angle.Zero; } }); @@ -90,7 +90,7 @@ namespace Content.MapRenderer.Painters // Skip empty grids if (grid.LocalAABB.IsEmpty()) { - Console.WriteLine($"Warning: Grid {grid.GridEntityId} was empty. Skipping image rendering."); + Console.WriteLine($"Warning: Grid {grid.Owner} was empty. Skipping image rendering."); continue; } @@ -119,8 +119,8 @@ namespace Content.MapRenderer.Painters var renderedImage = new RenderedGridImage(gridCanvas) { - GridUid = grid.GridEntityId, - Offset = xformQuery.GetComponent(grid.GridEntityId).WorldPosition + GridUid = grid.Owner, + Offset = xformQuery.GetComponent(grid.Owner).WorldPosition }; yield return renderedImage; diff --git a/Content.MapRenderer/Painters/TilePainter.cs b/Content.MapRenderer/Painters/TilePainter.cs index 09bfd53103..805792b2a3 100644 --- a/Content.MapRenderer/Painters/TilePainter.cs +++ b/Content.MapRenderer/Painters/TilePainter.cs @@ -57,7 +57,7 @@ namespace Content.MapRenderer.Painters i++; }); - Console.WriteLine($"{nameof(TilePainter)} painted {i} tiles on grid {grid.GridEntityId} in {(int) stopwatch.Elapsed.TotalMilliseconds} ms"); + Console.WriteLine($"{nameof(TilePainter)} painted {i} tiles on grid {grid.Owner} in {(int) stopwatch.Elapsed.TotalMilliseconds} ms"); } private Dictionary> GetTileImages( diff --git a/Content.Server/AME/AMENodeGroup.cs b/Content.Server/AME/AMENodeGroup.cs index ba23adb9e7..f0527966d9 100644 --- a/Content.Server/AME/AMENodeGroup.cs +++ b/Content.Server/AME/AMENodeGroup.cs @@ -46,7 +46,7 @@ namespace Content.Server.AME if (_entMan.TryGetComponent(nodeOwner, out AMEShieldComponent? shield)) { var xform = _entMan.GetComponent(nodeOwner); - if (xform.GridUid != grid?.GridEntityId && !mapManager.TryGetGrid(xform.GridUid, out grid)) + if (xform.GridUid != grid?.Owner && !mapManager.TryGetGrid(xform.GridUid, out grid)) continue; if (grid == null) diff --git a/Content.Server/Atmos/Commands/FillGasCommand.cs b/Content.Server/Atmos/Commands/FillGasCommand.cs index aa2690e40d..c4befa8510 100644 --- a/Content.Server/Atmos/Commands/FillGasCommand.cs +++ b/Content.Server/Atmos/Commands/FillGasCommand.cs @@ -31,7 +31,7 @@ namespace Content.Server.Atmos.Commands var atmosphereSystem = EntitySystem.Get(); - foreach (var tile in atmosphereSystem.GetAllMixtures(grid.GridEntityId, true)) + foreach (var tile in atmosphereSystem.GetAllMixtures(grid.Owner, true)) { tile.AdjustMoles(gasId, moles); } diff --git a/Content.Server/Atmos/Commands/SetAtmosTemperatureCommand.cs b/Content.Server/Atmos/Commands/SetAtmosTemperatureCommand.cs index 1fd57dacf9..d146655a52 100644 --- a/Content.Server/Atmos/Commands/SetAtmosTemperatureCommand.cs +++ b/Content.Server/Atmos/Commands/SetAtmosTemperatureCommand.cs @@ -37,7 +37,7 @@ namespace Content.Server.Atmos.Commands var atmosphereSystem = EntitySystem.Get(); var tiles = 0; - foreach (var tile in atmosphereSystem.GetAllMixtures(gridComp.GridEntityId, true)) + foreach (var tile in atmosphereSystem.GetAllMixtures(gridComp.Owner, true)) { tiles++; tile.Temperature = temperature; diff --git a/Content.Server/Atmos/Commands/SetTemperatureCommand.cs b/Content.Server/Atmos/Commands/SetTemperatureCommand.cs index adfb32b199..3645c64821 100644 --- a/Content.Server/Atmos/Commands/SetTemperatureCommand.cs +++ b/Content.Server/Atmos/Commands/SetTemperatureCommand.cs @@ -43,8 +43,8 @@ namespace Content.Server.Atmos.Commands var atmospheres = _entities.EntitySysManager.GetEntitySystem(); var indices = new Vector2i(x, y); - - var tile = atmospheres.GetTileMixture(grid.GridEntityId, null, indices, true); + + var tile = atmospheres.GetTileMixture(grid.Owner, null, indices, true); if (tile == null) { diff --git a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs index 797619dec3..d42222841a 100644 --- a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs @@ -43,7 +43,7 @@ namespace Content.Server.Atmos.EntitySystems // If the grid is deleting no point updating atmos. if (_mapManager.TryGetGrid(xform.GridUid, out var grid)) { - if (MetaData(grid.GridEntityId).EntityLifeStage > EntityLifeStage.MapInitialized) return; + if (MetaData(grid.Owner).EntityLifeStage > EntityLifeStage.MapInitialized) return; } SetAirblocked(airtight, false, xform); @@ -114,7 +114,7 @@ namespace Content.Server.Atmos.EntitySystems if (!_mapManager.TryGetGrid(gridId, out var grid)) return; - var gridUid = grid.GridEntityId; + var gridUid = grid.Owner; var query = EntityManager.GetEntityQuery(); _explosionSystem.UpdateAirtightMap(gridId, pos, query); diff --git a/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs b/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs index 174b54f05b..84db1bfb9c 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs @@ -138,7 +138,7 @@ namespace Content.Server.Atmos.EntitySystems foreach (var grid in _mapManager.FindGridsIntersecting(transform.MapID, worldBounds)) { - var uid = grid.GridEntityId; + var uid = grid.Owner; if (!Exists(uid)) continue; @@ -160,7 +160,7 @@ namespace Content.Server.Atmos.EntitySystems } } - RaiseNetworkEvent(new AtmosDebugOverlayMessage(grid.GridEntityId, baseTile, debugOverlayContent), session.ConnectedClient); + RaiseNetworkEvent(new AtmosDebugOverlayMessage(grid.Owner, baseTile, debugOverlayContent), session.ConnectedClient); } } } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs index 45fe16c4a6..d8c99f0f7a 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs @@ -128,12 +128,12 @@ public sealed partial class AtmosphereSystem if (playerMap == null) return CompletionResult.FromOptions(options); - foreach (var grid in _mapManager.GetAllMapGrids(playerMap.Value).OrderBy(o => o.GridEntityId)) + foreach (var grid in _mapManager.GetAllMapGrids(playerMap.Value).OrderBy(o => o.Owner)) { - if (!TryComp(grid.GridEntityId, out var gridXform)) + if (!TryComp(grid.Owner, out var gridXform)) continue; - options.Add(new CompletionOption(grid.GridEntityId.ToString(), $"{MetaData(grid.GridEntityId).EntityName} - Map {gridXform.MapID}")); + options.Add(new CompletionOption(grid.Owner.ToString(), $"{MetaData(grid.Owner).EntityName} - Map {gridXform.MapID}")); } return CompletionResult.FromOptions(options); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs index 609f56a934..6cb1c59697 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs @@ -65,7 +65,7 @@ public sealed partial class AtmosphereSystem if (!_mapManager.TryGetGrid(newGrid, out var mapGrid)) continue; - var entity = mapGrid.GridEntityId; + var entity = mapGrid.Owner; // If the new split grid has an atmosphere already somehow, use that. Otherwise, add a new one. if (!TryComp(entity, out GridAtmosphereComponent? newGridAtmos)) @@ -555,7 +555,7 @@ public sealed partial class AtmosphereSystem { var ev = new UpdateAdjacentMethodEvent(uid, position); GridUpdateAdjacent(uid, gridAtmosphere, ref ev); - InvalidateVisuals(mapGrid.GridEntityId, position); + InvalidateVisuals(mapGrid.Owner, position); } } } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs index b0ea868efc..fa419e98d3 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs @@ -480,7 +480,7 @@ namespace Content.Server.Atmos.EntitySystems { var direction = ((Vector2)_depressurizeTiles[tileCount - 1].GridIndices - tile.GridIndices).Normalized; - var gridPhysics = Comp(mapGrid.GridEntityId); + var gridPhysics = Comp(mapGrid.Owner); // TODO ATMOS: Come up with better values for these. gridPhysics.ApplyLinearImpulse(direction * totalMolesRemoved * gridPhysics.Mass); @@ -522,10 +522,10 @@ namespace Content.Server.Atmos.EntitySystems if (!reconsiderAdjacent) return; - var tileEv = new UpdateAdjacentMethodEvent(mapGrid.GridEntityId, tile.GridIndices); - var otherEv = new UpdateAdjacentMethodEvent(mapGrid.GridEntityId, other.GridIndices); - GridUpdateAdjacent(mapGrid.GridEntityId, gridAtmosphere, ref tileEv); - GridUpdateAdjacent(mapGrid.GridEntityId, gridAtmosphere, ref otherEv); + var tileEv = new UpdateAdjacentMethodEvent(mapGrid.Owner, tile.GridIndices); + var otherEv = new UpdateAdjacentMethodEvent(mapGrid.Owner, other.GridIndices); + GridUpdateAdjacent(mapGrid.Owner, gridAtmosphere, ref tileEv); + GridUpdateAdjacent(mapGrid.Owner, gridAtmosphere, ref otherEv); InvalidateVisuals(tile.GridIndex, tile.GridIndices); InvalidateVisuals(other.GridIndex, other.GridIndices); } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs index ede48828ed..80d637a867 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs @@ -49,7 +49,7 @@ namespace Content.Server.Atmos.EntitySystems if (!TryComp(uid, out MapGridComponent? mapGridComp)) return true; - var mapUid = _mapManager.GetMapEntityIdOrThrow(Transform(mapGridComp.Owner).MapID); + var mapUid = _mapManager.GetMapEntityIdOrThrow(Transform(((Component) mapGridComp).Owner).MapID); var volume = GetVolumeForTiles(mapGridComp, 1); @@ -58,7 +58,7 @@ namespace Content.Server.Atmos.EntitySystems { if (!atmosphere.Tiles.TryGetValue(indices, out var tile)) { - tile = new TileAtmosphere(mapGridComp.GridEntityId, indices, + tile = new TileAtmosphere(mapGridComp.Owner, indices, new GasMixture(volume) { Temperature = Atmospherics.T20C }); atmosphere.Tiles[indices] = tile; } @@ -126,7 +126,7 @@ namespace Content.Server.Atmos.EntitySystems tile.ThermalConductivity = tileDef?.ThermalConductivity ?? 0.5f; tile.HeatCapacity = tileDef?.HeatCapacity ?? float.PositiveInfinity; - InvalidateVisuals(mapGridComp.GridEntityId, indices); + InvalidateVisuals(mapGridComp.Owner, indices); for (var i = 0; i < Atmospherics.Directions; i++) { diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index af60012ed9..442911b09e 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -393,7 +393,7 @@ public sealed partial class CargoSystem foreach (var grid in _mapManager.GetAllMapGrids(xform.MapID)) { - var worldAABB = xformQuery.GetComponent(grid.GridEntityId).WorldMatrix.TransformBox(grid.LocalAABB); + var worldAABB = xformQuery.GetComponent(grid.Owner).WorldMatrix.TransformBox(grid.LocalAABB); aabb = aabb?.Union(worldAABB) ?? worldAABB; } diff --git a/Content.Server/Cargo/Systems/PricingSystem.cs b/Content.Server/Cargo/Systems/PricingSystem.cs index e4d7568a7c..eaa836530e 100644 --- a/Content.Server/Cargo/Systems/PricingSystem.cs +++ b/Content.Server/Cargo/Systems/PricingSystem.cs @@ -66,7 +66,7 @@ public sealed class PricingSystem : EntitySystem List<(double, EntityUid)> mostValuable = new(); - var value = AppraiseGrid(mapGrid.GridEntityId, null, (uid, price) => + var value = AppraiseGrid(mapGrid.Owner, null, (uid, price) => { mostValuable.Add((price, uid)); mostValuable.Sort((i1, i2) => i2.Item1.CompareTo(i1.Item1)); diff --git a/Content.Server/Chunking/ChunkingSystem.cs b/Content.Server/Chunking/ChunkingSystem.cs index 0846dc5735..be0e37971f 100644 --- a/Content.Server/Chunking/ChunkingSystem.cs +++ b/Content.Server/Chunking/ChunkingSystem.cs @@ -89,13 +89,13 @@ public sealed class ChunkingSystem : EntitySystem foreach (var grid in _mapManager.FindGridsIntersecting(xform.MapID, bounds, true)) { - if (!chunks.TryGetValue(grid.GridEntityId, out var set)) + if (!chunks.TryGetValue(grid.Owner, out var set)) { - chunks[grid.GridEntityId] = set = indexPool.Get(); + chunks[grid.Owner] = set = indexPool.Get(); DebugTools.Assert(set.Count == 0); } - var enumerator = new ChunkIndicesEnumerator(_transform.GetInvWorldMatrix(grid.GridEntityId, xformQuery).TransformBox(bounds), chunkSize); + var enumerator = new ChunkIndicesEnumerator(_transform.GetInvWorldMatrix(grid.Owner, xformQuery).TransformBox(bounds), chunkSize); while (enumerator.MoveNext(out var indices)) { diff --git a/Content.Server/Construction/Commands/FixRotationsCommand.cs b/Content.Server/Construction/Commands/FixRotationsCommand.cs index 8d933ef04c..307f0159a9 100644 --- a/Content.Server/Construction/Commands/FixRotationsCommand.cs +++ b/Content.Server/Construction/Commands/FixRotationsCommand.cs @@ -56,7 +56,7 @@ namespace Content.Server.Construction.Commands return; } - if (!entityManager.EntityExists(grid.GridEntityId)) + if (!entityManager.EntityExists(grid.Owner)) { shell.WriteError($"Grid {gridId} doesn't have an associated grid entity."); return; @@ -65,7 +65,7 @@ namespace Content.Server.Construction.Commands var changed = 0; var tagSystem = entityManager.EntitySysManager.GetEntitySystem(); - foreach (var child in xformQuery.GetComponent(grid.GridEntityId).ChildEntities) + foreach (var child in xformQuery.GetComponent(grid.Owner).ChildEntities) { if (!entityManager.EntityExists(child)) { diff --git a/Content.Server/Construction/Commands/TileReplaceCommand.cs b/Content.Server/Construction/Commands/TileReplaceCommand.cs index 3794dfd424..c730c81f8d 100644 --- a/Content.Server/Construction/Commands/TileReplaceCommand.cs +++ b/Content.Server/Construction/Commands/TileReplaceCommand.cs @@ -62,7 +62,7 @@ sealed class TileReplaceCommand : IConsoleCommand return; } - if (!entityManager.EntityExists(grid.GridEntityId)) + if (!entityManager.EntityExists(grid.Owner)) { shell.WriteLine($"Grid {gridId} doesn't have an associated grid entity."); return; diff --git a/Content.Server/Construction/Commands/TileWallsCommand.cs b/Content.Server/Construction/Commands/TileWallsCommand.cs index 12e592eb0b..2f507f916f 100644 --- a/Content.Server/Construction/Commands/TileWallsCommand.cs +++ b/Content.Server/Construction/Commands/TileWallsCommand.cs @@ -57,7 +57,7 @@ namespace Content.Server.Construction.Commands return; } - if (!entityManager.EntityExists(grid.GridEntityId)) + if (!entityManager.EntityExists(grid.Owner)) { shell.WriteLine($"Grid {gridId} doesn't have an associated grid entity."); return; @@ -68,7 +68,7 @@ namespace Content.Server.Construction.Commands var underplating = tileDefinitionManager[TilePrototypeId]; var underplatingTile = new Tile(underplating.TileId); var changed = 0; - foreach (var child in entityManager.GetComponent(grid.GridEntityId).ChildEntities) + foreach (var child in entityManager.GetComponent(grid.Owner).ChildEntities) { if (!entityManager.EntityExists(child)) { diff --git a/Content.Server/Decals/Commands/AddDecalCommand.cs b/Content.Server/Decals/Commands/AddDecalCommand.cs index 9ed0e43327..dc2c179a3e 100644 --- a/Content.Server/Decals/Commands/AddDecalCommand.cs +++ b/Content.Server/Decals/Commands/AddDecalCommand.cs @@ -46,7 +46,7 @@ namespace Content.Server.Decals.Commands return; } - var coordinates = new EntityCoordinates(grid.GridEntityId, new Vector2(x, y)); + var coordinates = new EntityCoordinates(grid.Owner, new Vector2(x, y)); if (grid.GetTileRef(coordinates).IsSpace()) { shell.WriteError($"Cannot create decal on space tile at {coordinates}."); diff --git a/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs b/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs index 61037defa8..d5f9557bd0 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs @@ -64,11 +64,11 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood } } - if (referenceGrid == Grid.GridEntityId) + if (referenceGrid == Grid.Owner) return; _needToTransform = true; - var transform = IoCManager.Resolve().GetComponent(Grid.GridEntityId); + var transform = IoCManager.Resolve().GetComponent(Grid.Owner); var size = (float) Grid.TileSize; _matrix.R0C2 = size / 2; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs index 75519900da..9125b22876 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs @@ -63,8 +63,8 @@ public sealed partial class ExplosionSystem : EntitySystem var tolerance = new float[_explosionTypes.Count]; var blockedDirections = AtmosDirection.Invalid; - if (!_airtightMap.ContainsKey(grid.GridEntityId)) - _airtightMap[grid.GridEntityId] = new(); + if (!_airtightMap.ContainsKey(grid.Owner)) + _airtightMap[grid.Owner] = new(); query ??= EntityManager.GetEntityQuery(); var damageQuery = EntityManager.GetEntityQuery(); @@ -84,9 +84,9 @@ public sealed partial class ExplosionSystem : EntitySystem } if (blockedDirections != AtmosDirection.Invalid) - _airtightMap[grid.GridEntityId][tile] = new(tolerance, blockedDirections); + _airtightMap[grid.Owner][tile] = new(tolerance, blockedDirections); else - _airtightMap[grid.GridEntityId].Remove(tile); + _airtightMap[grid.Owner].Remove(tile); } /// diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs index 2b34dc181f..c8d3259b8c 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs @@ -59,7 +59,7 @@ public sealed partial class ExplosionSystem : EntitySystem if (referenceGrid != null) { var targetGrid = _mapManager.GetGrid(referenceGrid.Value); - var xform = Transform(targetGrid.GridEntityId); + var xform = Transform(targetGrid.Owner); targetAngle = xform.WorldRotation; targetMatrix = xform.InvWorldMatrix; tileSize = targetGrid.TileSize; @@ -93,7 +93,7 @@ public sealed partial class ExplosionSystem : EntitySystem } var xforms = EntityManager.GetEntityQuery(); - var xform = xforms.GetComponent(grid.GridEntityId); + var xform = xforms.GetComponent(grid.Owner); var (_, gridWorldRotation, gridWorldMatrix, invGridWorldMatrid) = xform.GetWorldPositionRotationMatrixWithInv(xforms); var localEpicentre = (Vector2i) invGridWorldMatrid.Transform(epicentre.Position); diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs index 0497790775..1bc4053eef 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs @@ -637,7 +637,7 @@ sealed class Explosion _explosionData.Add(new() { TileLists = grid.TileLists, - Lookup = entMan.GetComponent(grid.Grid.Owner), + Lookup = entMan.GetComponent(((Component) grid.Grid).Owner), MapGrid = grid.Grid }); } @@ -678,7 +678,7 @@ sealed class Explosion _currentDataIndex++; // sanity checks, in case something changed while the explosion was being processed over several ticks. - if (_currentLookup.Deleted || _currentGrid != null && !_entMan.EntityExists(_currentGrid.GridEntityId)) + if (_currentLookup.Deleted || _currentGrid != null && !_entMan.EntityExists(_currentGrid.Owner)) continue; return true; @@ -799,7 +799,7 @@ sealed class Explosion foreach (var (grid, list) in _tileUpdateDict) { - if (list.Count > 0 && _entMan.EntityExists(grid.GridEntityId)) + if (list.Count > 0 && _entMan.EntityExists(grid.Owner)) { grid.SetTiles(list); } diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs index 881bfe2a4e..e868dde645 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs @@ -48,7 +48,7 @@ public sealed partial class ExplosionSystem : EntitySystem candidateGrid.TryGetTileRef(candidateGrid.WorldToTile(epicenter.Position), out var tileRef) && !tileRef.Tile.IsEmpty) { - epicentreGrid = candidateGrid.GridEntityId; + epicentreGrid = candidateGrid.Owner; initialTile = tileRef.GridIndices; } else if (referenceGrid != null) @@ -85,7 +85,7 @@ public sealed partial class ExplosionSystem : EntitySystem var spaceAngle = Angle.Zero; if (referenceGrid != null) { - var xform = Transform(_mapManager.GetGrid(referenceGrid.Value).GridEntityId); + var xform = Transform(_mapManager.GetGrid(referenceGrid.Value).Owner); spaceMatrix = xform.WorldMatrix; spaceAngle = xform.WorldRotation; } @@ -276,10 +276,10 @@ public sealed partial class ExplosionSystem : EntitySystem foreach (var grid in _mapManager.FindGridsIntersecting(epicenter.MapId, box)) { - if (TryComp(grid.GridEntityId, out PhysicsComponent? physics) && physics.Mass > mass) + if (TryComp(grid.Owner, out PhysicsComponent? physics) && physics.Mass > mass) { mass = physics.Mass; - referenceGrid = grid.GridEntityId; + referenceGrid = grid.Owner; } } @@ -295,7 +295,7 @@ public sealed partial class ExplosionSystem : EntitySystem radius *= 4; box = Box2.CenteredAround(epicenter.Position, (radius, radius)); var mapGrids = _mapManager.FindGridsIntersecting(epicenter.MapId, box).ToList(); - var grids = mapGrids.Select(x => x.GridEntityId).ToList(); + var grids = mapGrids.Select(x => x.Owner).ToList(); if (referenceGrid != null) return (grids, referenceGrid, radius); @@ -303,10 +303,10 @@ public sealed partial class ExplosionSystem : EntitySystem // We still don't have are reference grid. So lets also look in the enlarged region foreach (var grid in mapGrids) { - if (TryComp(grid.GridEntityId, out PhysicsComponent? physics) && physics.Mass > mass) + if (TryComp(grid.Owner, out PhysicsComponent? physics) && physics.Mass > mass) { mass = physics.Mass; - referenceGrid = grid.GridEntityId; + referenceGrid = grid.Owner; } } diff --git a/Content.Server/Fluids/EntitySystems/PuddleDebugDebugOverlaySystem.cs b/Content.Server/Fluids/EntitySystems/PuddleDebugDebugOverlaySystem.cs index 606f4356fe..6799623f8e 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleDebugDebugOverlaySystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleDebugDebugOverlaySystem.cs @@ -59,7 +59,7 @@ public sealed class PuddleDebugDebugOverlaySystem : SharedPuddleDebugOverlaySyst foreach (var grid in _mapManager.FindGridsIntersecting(transform.MapID, worldBounds)) { var data = new List(); - var gridUid = grid.GridEntityId; + var gridUid = grid.Owner; if (!Exists(gridUid)) continue; diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index ef08084ccc..c7801ab685 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -312,13 +312,13 @@ namespace Content.Server.GameTicking { foreach (var grid in _mapManager.GetAllGrids()) { - if (!metaQuery.TryGetComponent(grid.GridEntityId, out var meta) || + if (!metaQuery.TryGetComponent(grid.Owner, out var meta) || meta.EntityPaused) { continue; } - _possiblePositions.Add(new EntityCoordinates(grid.GridEntityId, Vector2.Zero)); + _possiblePositions.Add(new EntityCoordinates(grid.Owner, Vector2.Zero)); } } @@ -332,9 +332,9 @@ namespace Content.Server.GameTicking if (_mapManager.TryFindGridAt(toMap, out var foundGrid)) { - var gridXform = Transform(foundGrid.GridEntityId); + var gridXform = Transform(foundGrid.Owner); - return new EntityCoordinates(foundGrid.GridEntityId, + return new EntityCoordinates(foundGrid.Owner, gridXform.InvWorldMatrix.Transform(toMap.Position)); } diff --git a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs index 11b6065381..f502d7b4c5 100644 --- a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs +++ b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs @@ -596,13 +596,13 @@ public sealed partial class PathfindingSystem var polyData = points[x * SubStep + poly.Left, y * SubStep + poly.Bottom].Data; var neighbors = new HashSet(); - tilePoly.Add(new PathPoly(grid.GridEntityId, chunk.Origin, GetIndex(x, y), box, polyData, neighbors)); + tilePoly.Add(new PathPoly(grid.Owner, chunk.Origin, GetIndex(x, y), box, polyData, neighbors)); } } } // _sawmill.Debug($"Built breadcrumbs in {sw.Elapsed.TotalMilliseconds}ms"); - SendBreadcrumbs(chunk, grid.GridEntityId); + SendBreadcrumbs(chunk, grid.Owner); } /// diff --git a/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs b/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs index 1ae9737939..3149f2a5f1 100644 --- a/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs +++ b/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs @@ -147,7 +147,7 @@ public sealed partial class NPCCombatSystem if (_mapManager.TryFindGridAt(xform.MapID, targetPos, out var mapGrid)) { - targetCordinates = new EntityCoordinates(mapGrid.GridEntityId, mapGrid.WorldToLocal(targetSpot)); + targetCordinates = new EntityCoordinates(mapGrid.Owner, mapGrid.WorldToLocal(targetSpot)); } else { diff --git a/Content.Server/Physics/Controllers/ConveyorController.cs b/Content.Server/Physics/Controllers/ConveyorController.cs index fba3064ab9..7a8966d53a 100644 --- a/Content.Server/Physics/Controllers/ConveyorController.cs +++ b/Content.Server/Physics/Controllers/ConveyorController.cs @@ -289,7 +289,7 @@ namespace Content.Server.Physics.Controllers foreach (var entity in comp.Intersecting) { if (!xformQuery.TryGetComponent(entity, out var entityXform) || - entityXform.ParentUid != grid.GridEntityId) + entityXform.ParentUid != grid.Owner) { continue; } diff --git a/Content.Server/Physics/Controllers/MoverController.cs b/Content.Server/Physics/Controllers/MoverController.cs index 6e46fa0e13..8e41db304d 100644 --- a/Content.Server/Physics/Controllers/MoverController.cs +++ b/Content.Server/Physics/Controllers/MoverController.cs @@ -251,7 +251,7 @@ namespace Content.Server.Physics.Controllers var gridId = xform.GridUid; // This tries to see if the grid is a shuttle and if the console should work. if (!_mapManager.TryGetGrid(gridId, out var grid) || - !EntityManager.TryGetComponent(grid.GridEntityId, out ShuttleComponent? shuttleComponent) || + !EntityManager.TryGetComponent(grid.Owner, out ShuttleComponent? shuttleComponent) || !shuttleComponent.Enabled) continue; if (!newPilots.TryGetValue(shuttleComponent, out var pilots)) diff --git a/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs b/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs index b2e544a5a3..23bad50dea 100644 --- a/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs +++ b/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs @@ -51,7 +51,7 @@ namespace Content.Server.Power.EntitySystems // If grid deleting no need to update power. if (_mapManager.TryGetGrid(xform.GridUid, out var grid)) { - if (MetaData(grid.GridEntityId).EntityLifeStage > EntityLifeStage.MapInitialized) return; + if (MetaData(grid.Owner).EntityLifeStage > EntityLifeStage.MapInitialized) return; } Disconnect(uid, provider); diff --git a/Content.Server/RCD/Systems/RCDSystem.cs b/Content.Server/RCD/Systems/RCDSystem.cs index ef2306b8ce..c7fa4c6280 100644 --- a/Content.Server/RCD/Systems/RCDSystem.cs +++ b/Content.Server/RCD/Systems/RCDSystem.cs @@ -139,12 +139,12 @@ namespace Content.Server.RCD.Systems case RcdMode.Walls: var ent = EntityManager.SpawnEntity("WallSolid", mapGrid.GridTileToLocal(snapPos)); Transform(ent).LocalRotation = Angle.Zero; // Walls always need to point south. - _adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(ent)} at {snapPos} on grid {mapGrid.GridEntityId}"); + _adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(ent)} at {snapPos} on grid {mapGrid.Owner}"); break; case RcdMode.Airlock: var airlock = EntityManager.SpawnEntity("Airlock", mapGrid.GridTileToLocal(snapPos)); Transform(airlock).LocalRotation = Transform(rcd.Owner).LocalRotation; //Now apply icon smoothing. - _adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(airlock)} at {snapPos} on grid {mapGrid.GridEntityId}"); + _adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(airlock)} at {snapPos} on grid {mapGrid.Owner}"); break; default: args.Handled = true; diff --git a/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs b/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs index 3e19750f2f..6aa8d0d178 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs @@ -60,7 +60,7 @@ public partial class RadiationSystem foreach (var grid in _mapManager.GetAllGrids()) { - var gridUid = grid.GridEntityId; + var gridUid = grid.Owner; if (!query.TryGetComponent(gridUid, out var resistance)) continue; diff --git a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs index 486a674ea2..4097b978eb 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs @@ -136,7 +136,7 @@ public partial class RadiationSystem // the ray will be updated with each grid that has some blockers foreach (var grid in grids) { - ray = Gridcast(grid, ray, saveVisitedTiles, resistanceQuery, sourceTrs, destTrs, transformQuery.GetComponent(grid.GridEntityId)); + ray = Gridcast(grid, ray, saveVisitedTiles, resistanceQuery, sourceTrs, destTrs, transformQuery.GetComponent(grid.Owner)); // looks like last grid blocked all radiation // we can return right now @@ -156,7 +156,7 @@ public partial class RadiationSystem var blockers = new List<(Vector2i, float)>(); // if grid doesn't have resistance map just apply distance penalty - var gridUid = grid.GridEntityId; + var gridUid = grid.Owner; if (!resistanceQuery.TryGetComponent(gridUid, out var resistance)) return ray; var resistanceMap = resistance.ResistancePerTile; @@ -167,11 +167,11 @@ public partial class RadiationSystem // If ever grids are allowed to overlap, this might no longer be true. In that case, this should precompute and cache // inverse world matrices. - Vector2 srcLocal = sourceTrs.ParentUid == grid.GridEntityId + Vector2 srcLocal = sourceTrs.ParentUid == grid.Owner ? sourceTrs.LocalPosition : gridTrs.InvLocalMatrix.Transform(ray.Source); - Vector2 dstLocal = destTrs.ParentUid == grid.GridEntityId + Vector2 dstLocal = destTrs.ParentUid == grid.Owner ? destTrs.LocalPosition : gridTrs.InvLocalMatrix.Transform(ray.Destination); diff --git a/Content.Server/Salvage/SalvageRulerCommand.cs b/Content.Server/Salvage/SalvageRulerCommand.cs index 59cfbf90e9..9dcf7fc36e 100644 --- a/Content.Server/Salvage/SalvageRulerCommand.cs +++ b/Content.Server/Salvage/SalvageRulerCommand.cs @@ -50,7 +50,7 @@ sealed class SalvageRulerCommand : IConsoleCommand var first = true; foreach (var mapGrid in _maps.GetAllMapGrids(entityTransform.MapID)) { - var aabb = _entities.GetComponent(mapGrid.GridEntityId).WorldMatrix.TransformBox(mapGrid.LocalAABB); + var aabb = _entities.GetComponent(mapGrid.Owner).WorldMatrix.TransformBox(mapGrid.LocalAABB); if (first) { total = aabb; diff --git a/Content.Server/Salvage/SalvageSystem.cs b/Content.Server/Salvage/SalvageSystem.cs index 1014df9445..04eae75fd0 100644 --- a/Content.Server/Salvage/SalvageSystem.cs +++ b/Content.Server/Salvage/SalvageSystem.cs @@ -263,7 +263,7 @@ namespace Content.Server.Salvage var tsc = Transform(component.Owner); coords = new EntityCoordinates(component.Owner, component.Offset).ToMap(EntityManager); - if (_mapManager.TryGetGrid(tsc.GridUid, out var magnetGrid) && TryComp(magnetGrid.GridEntityId, out var gridXform)) + if (_mapManager.TryGetGrid(tsc.GridUid, out var magnetGrid) && TryComp(magnetGrid.Owner, out var gridXform)) { angle = gridXform.WorldRotation; } diff --git a/Content.Server/Shuttles/Systems/DockingSystem.cs b/Content.Server/Shuttles/Systems/DockingSystem.cs index 5a2f7c384f..534749e112 100644 --- a/Content.Server/Shuttles/Systems/DockingSystem.cs +++ b/Content.Server/Shuttles/Systems/DockingSystem.cs @@ -70,7 +70,7 @@ namespace Content.Server.Shuttles.Systems // Assume the docking port itself (and its body) is valid if (!_mapManager.TryGetGrid(dockingXform.GridUid, out var grid) || - !HasComp(grid.GridEntityId)) return null; + !HasComp(grid.Owner)) return null; var transform = body.GetTransform(); var dockingFixture = _fixtureSystem.GetFixtureOrNull(body, DockingFixture); @@ -92,7 +92,7 @@ namespace Content.Server.Shuttles.Systems // Get any docking ports in range on other grids. foreach (var otherGrid in _mapManager.FindGridsIntersecting(dockingXform.MapID, enlargedAABB)) { - if (otherGrid.GridEntityId == dockingXform.GridUid) + if (otherGrid.Owner == dockingXform.GridUid) continue; foreach (var ent in otherGrid.GetAnchoredEntities(enlargedAABB)) @@ -353,7 +353,7 @@ namespace Content.Server.Shuttles.Systems dockB.DockJointId = joint.ID; if (TryComp(dockA.Owner, out DoorComponent? doorA)) - { + { if (_doorSystem.TryOpen(doorA.Owner, doorA)) { doorA.ChangeAirtight = false; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs index c9bf2d243e..9914408ed0 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs @@ -165,7 +165,7 @@ public sealed partial class ShuttleSystem // Check if there's no intersecting grids (AKA oh god it's docking at cargo). if (_mapManager.FindGridsIntersecting(targetGridXform.MapID, - dockedBounds).Any(o => o.GridEntityId != targetGrid)) + dockedBounds).Any(o => o.Owner != targetGrid)) { continue; } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index b3e4742904..ca293d7b98 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -101,8 +101,8 @@ public sealed partial class ShuttleSystem foreach (var other in _mapManager.FindGridsIntersecting(xform.MapID, bounds)) { - if (grid.Owner == other.GridEntityId || - !bodyQuery.TryGetComponent(other.GridEntityId, out var body) || + if (((Component) grid).Owner == other.Owner || + !bodyQuery.TryGetComponent(other.Owner, out var body) || body.Mass < ShuttleFTLMassThreshold) continue; reason = Loc.GetString("shuttle-console-proximity"); @@ -485,10 +485,10 @@ public sealed partial class ShuttleSystem { foreach (var grid in _mapManager.FindGridsIntersecting(mapId, targetAABB)) { - if (!nearbyGrids.Add(grid.GridEntityId)) continue; + if (!nearbyGrids.Add(grid.Owner)) continue; - targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery) - .TransformBox(Comp(grid.GridEntityId).LocalAABB)); + targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.Owner, xformQuery) + .TransformBox(Comp(grid.Owner).LocalAABB)); } // Can do proximity @@ -508,10 +508,10 @@ public sealed partial class ShuttleSystem foreach (var grid in _mapManager.GetAllGrids()) { // Don't add anymore as it is irrelevant, but that doesn't mean we need to re-do existing work. - if (nearbyGrids.Contains(grid.GridEntityId)) continue; + if (nearbyGrids.Contains(grid.Owner)) continue; - targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery) - .TransformBox(Comp(grid.GridEntityId).LocalAABB)); + targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.Owner, xformQuery) + .TransformBox(Comp(grid.Owner).LocalAABB)); } break; diff --git a/Content.Server/Shuttles/Systems/ThrusterSystem.cs b/Content.Server/Shuttles/Systems/ThrusterSystem.cs index d3a4b1d78d..ad025eb3b2 100644 --- a/Content.Server/Shuttles/Systems/ThrusterSystem.cs +++ b/Content.Server/Shuttles/Systems/ThrusterSystem.cs @@ -147,7 +147,7 @@ namespace Content.Server.Shuttles.Systems component.Type != ThrusterType.Linear || !EntityManager.TryGetComponent(uid, out TransformComponent? xform) || !_mapManager.TryGetGrid(xform.GridUid, out var grid) || - !EntityManager.TryGetComponent(grid.GridEntityId, out ShuttleComponent? shuttleComponent)) + !EntityManager.TryGetComponent(grid.Owner, out ShuttleComponent? shuttleComponent)) { return; } @@ -246,7 +246,7 @@ namespace Content.Server.Shuttles.Systems component.IsOn = true; - if (!EntityManager.TryGetComponent(grid.GridEntityId, out ShuttleComponent? shuttleComponent)) return; + if (!EntityManager.TryGetComponent(grid.Owner, out ShuttleComponent? shuttleComponent)) return; // Logger.DebugS("thruster", $"Enabled thruster {uid}"); @@ -317,7 +317,7 @@ namespace Content.Server.Shuttles.Systems component.IsOn = false; - if (!EntityManager.TryGetComponent(grid.GridEntityId, out ShuttleComponent? shuttleComponent)) return; + if (!EntityManager.TryGetComponent(grid.Owner, out ShuttleComponent? shuttleComponent)) return; // Logger.DebugS("thruster", $"Disabled thruster {uid}"); diff --git a/Content.Server/Station/Systems/StationSystem.cs b/Content.Server/Station/Systems/StationSystem.cs index 26762b0393..a8bf2290a7 100644 --- a/Content.Server/Station/Systems/StationSystem.cs +++ b/Content.Server/Station/Systems/StationSystem.cs @@ -398,11 +398,11 @@ public sealed class StationSystem : EntitySystem var stationMember = AddComp(mapGrid); stationMember.Station = station; - stationData.Grids.Add(gridComponent.Owner); + stationData.Grids.Add(((Component) gridComponent).Owner); - RaiseLocalEvent(station, new StationGridAddedEvent(gridComponent.Owner, false), true); + RaiseLocalEvent(station, new StationGridAddedEvent(((Component) gridComponent).Owner, false), true); - _sawmill.Info($"Adding grid {mapGrid}:{gridComponent.Owner} to station {Name(station)} ({station})"); + _sawmill.Info($"Adding grid {mapGrid}:{((Component) gridComponent).Owner} to station {Name(station)} ({station})"); } /// @@ -421,10 +421,10 @@ public sealed class StationSystem : EntitySystem throw new ArgumentException("Tried to use a non-station entity as a station!", nameof(station)); RemComp(mapGrid); - stationData.Grids.Remove(gridComponent.Owner); + stationData.Grids.Remove(((Component) gridComponent).Owner); - RaiseLocalEvent(station, new StationGridRemovedEvent(gridComponent.Owner), true); - _sawmill.Info($"Removing grid {mapGrid}:{gridComponent.Owner} from station {Name(station)} ({station})"); + RaiseLocalEvent(station, new StationGridRemovedEvent(((Component) gridComponent).Owner), true); + _sawmill.Info($"Removing grid {mapGrid}:{((Component) gridComponent).Owner} from station {Name(station)} ({station})"); } /// diff --git a/Content.Server/StationEvents/Events/MeteorSwarm.cs b/Content.Server/StationEvents/Events/MeteorSwarm.cs index 63fa841f78..042b32991f 100644 --- a/Content.Server/StationEvents/Events/MeteorSwarm.cs +++ b/Content.Server/StationEvents/Events/MeteorSwarm.cs @@ -70,7 +70,7 @@ namespace Content.Server.StationEvents.Events foreach (var grid in MapManager.GetAllMapGrids(mapId)) { - if (!TryComp(grid.GridEntityId, out var gridBody)) + if (!TryComp(grid.Owner, out var gridBody)) { continue; } diff --git a/Content.Server/StationEvents/Events/StationEventSystem.cs b/Content.Server/StationEvents/Events/StationEventSystem.cs index ad16bca20c..bbf73f901f 100644 --- a/Content.Server/StationEvents/Events/StationEventSystem.cs +++ b/Content.Server/StationEvents/Events/StationEventSystem.cs @@ -159,9 +159,9 @@ namespace Content.Server.StationEvents.Events var randomY = RobustRandom.Next((int) gridBounds.Bottom, (int) gridBounds.Top); tile = new Vector2i(randomX - (int) gridPos.X, randomY - (int) gridPos.Y); - if (_atmosphere.IsTileSpace(gridComp.GridEntityId, Transform(targetGrid).MapUid, tile, + if (_atmosphere.IsTileSpace(gridComp.Owner, Transform(targetGrid).MapUid, tile, mapGridComp: gridComp) - || _atmosphere.IsTileAirBlocked(gridComp.GridEntityId, tile, mapGridComp: gridComp)) + || _atmosphere.IsTileAirBlocked(gridComp.Owner, tile, mapGridComp: gridComp)) { continue; } diff --git a/Content.Server/Tiles/FloorTileSystem.cs b/Content.Server/Tiles/FloorTileSystem.cs index b4f90327dd..226197098f 100644 --- a/Content.Server/Tiles/FloorTileSystem.cs +++ b/Content.Server/Tiles/FloorTileSystem.cs @@ -76,9 +76,9 @@ namespace Content.Server.Tiles else if (HasBaseTurf(currentTileDefinition, ContentTileDefinition.SpaceID)) { mapGrid = _mapManager.CreateGrid(locationMap.MapId); - var gridXform = Transform(mapGrid.GridEntityId); + var gridXform = Transform(mapGrid.Owner); gridXform.WorldPosition = locationMap.Position; - location = new EntityCoordinates(mapGrid.GridEntityId, Vector2.Zero); + location = new EntityCoordinates(mapGrid.Owner, Vector2.Zero); PlaceAt(mapGrid, location, _tileDefinitionManager[component.OutputTiles[0]].TileId, component.PlaceTileSound, mapGrid.TileSize / 2f); } } diff --git a/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs b/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs index fa2a9d941b..c50bbb1579 100644 --- a/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs +++ b/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs @@ -22,17 +22,17 @@ namespace Content.Shared.Coordinates public static EntityCoordinates ToCoordinates(this MapGridComponent grid, Vector2 offset) { - return ToCoordinates(grid.GridEntityId, offset); + return ToCoordinates(grid.Owner, offset); } public static EntityCoordinates ToCoordinates(this MapGridComponent grid, float x, float y) { - return ToCoordinates(grid.GridEntityId, x, y); + return ToCoordinates(grid.Owner, x, y); } public static EntityCoordinates ToCoordinates(this MapGridComponent grid) { - return ToCoordinates(grid.GridEntityId, Vector2.Zero); + return ToCoordinates(grid.Owner, Vector2.Zero); } } } diff --git a/Content.Shared/Maps/TurfHelpers.cs b/Content.Shared/Maps/TurfHelpers.cs index 4701a8633d..4d6eef488f 100644 --- a/Content.Shared/Maps/TurfHelpers.cs +++ b/Content.Shared/Maps/TurfHelpers.cs @@ -258,7 +258,7 @@ namespace Content.Shared.Maps if (map.TryGetGrid(turf.GridUid, out var tileGrid)) { - var gridRot = entManager.GetComponent(tileGrid.GridEntityId).WorldRotation; + var gridRot = entManager.GetComponent(tileGrid.Owner).WorldRotation; // This is scaled to 90 % so it doesn't encompass walls on other tiles. var tileBox = Box2.UnitCentered.Scale(0.9f); diff --git a/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs b/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs index 19e873ff72..c3bfc54500 100644 --- a/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs +++ b/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs @@ -70,7 +70,7 @@ namespace Content.Shared.Movement.Components return false; } - if (!entityManager.GetComponent(grid.GridEntityId).EnabledVV) + if (!entityManager.GetComponent(grid.Owner).EnabledVV) { return true; }