diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs index 20a5a7042d..53c3fe8d0b 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs @@ -42,8 +42,8 @@ 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.Maps => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), + ObjectsTabSelection.Grids => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), + ObjectsTabSelection.Maps => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), _ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null) }; diff --git a/Content.Server/Administration/Commands/VariantizeCommand.cs b/Content.Server/Administration/Commands/VariantizeCommand.cs index 800e2c487b..d0e5d65297 100644 --- a/Content.Server/Administration/Commands/VariantizeCommand.cs +++ b/Content.Server/Administration/Commands/VariantizeCommand.cs @@ -32,7 +32,7 @@ public sealed class VariantizeCommand : IConsoleCommand return; } - if (!entMan.TryGetComponent(euid, out IMapGridComponent? gridComp)) + if (!entMan.TryGetComponent(euid, out MapGridComponent? gridComp)) { shell.WriteError($"Euid '{euid}' does not exist or is not a grid."); return; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index b9204a6d14..7aa33a6108 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -87,7 +87,7 @@ public sealed partial class AdminVerbSystem return; // 1984. - if (HasComp(args.Target) || HasComp(args.Target)) + if (HasComp(args.Target) || HasComp(args.Target)) return; Verb explode = new() diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs index c866a8bdd4..4bc2f1701b 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs @@ -687,7 +687,7 @@ public sealed partial class AdminVerbSystem args.Verbs.Add(haltMovement); } - if (TryComp(args.Target, out var map)) + if (TryComp(args.Target, out var map)) { if (_adminManager.HasAdminFlag(player, AdminFlags.Mapping)) { @@ -800,7 +800,7 @@ public sealed partial class AdminVerbSystem private bool TryGetGridChildren(EntityUid target, [NotNullWhen(true)] out IEnumerable? enumerator) { - if (!HasComp(target) && !HasComp(target) && + if (!HasComp(target) && !HasComp(target) && !HasComp(target)) { enumerator = null; @@ -827,7 +827,7 @@ public sealed partial class AdminVerbSystem yield break; } - else if (HasComp(target)) + else if (HasComp(target)) { foreach (var possibleGrid in Transform(target).ChildEntities) { diff --git a/Content.Server/Atmos/Commands/AddAtmosCommand.cs b/Content.Server/Atmos/Commands/AddAtmosCommand.cs index 6ba58bc0d8..1b5ba2aa96 100644 --- a/Content.Server/Atmos/Commands/AddAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/AddAtmosCommand.cs @@ -31,7 +31,7 @@ namespace Content.Server.Atmos.Commands return; } - if (!entMan.HasComponent(euid)) + if (!entMan.HasComponent(euid)) { shell.WriteError($"Euid '{euid}' does not exist or is not a grid."); return; diff --git a/Content.Server/Atmos/Commands/AddGasCommand.cs b/Content.Server/Atmos/Commands/AddGasCommand.cs index e614210740..24bf32db97 100644 --- a/Content.Server/Atmos/Commands/AddGasCommand.cs +++ b/Content.Server/Atmos/Commands/AddGasCommand.cs @@ -25,7 +25,7 @@ namespace Content.Server.Atmos.Commands || !float.TryParse(args[4], out var moles)) return; var entMan = IoCManager.Resolve(); - if (!entMan.HasComponent(euid)) + if (!entMan.HasComponent(euid)) { shell.WriteError($"Euid '{euid}' does not exist or is not a grid."); return; diff --git a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs index b42e8d6a8a..7a608b1d38 100644 --- a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs @@ -56,7 +56,7 @@ namespace Content.Server.Atmos.EntitySystems { var xform = Transform(uid); - if (!TryComp(xform.GridUid, out IMapGridComponent? grid)) + if (!TryComp(xform.GridUid, out MapGridComponent? grid)) return; var gridId = xform.GridUid; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs index 8eaac8ebfb..2c0b158893 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs @@ -121,7 +121,7 @@ public partial class AtmosphereSystem return ev.Result; } - public bool IsTileAirBlocked(EntityUid gridUid, Vector2i tile, AtmosDirection directions = AtmosDirection.All, IMapGridComponent? mapGridComp = null) + public bool IsTileAirBlocked(EntityUid gridUid, Vector2i tile, AtmosDirection directions = AtmosDirection.All, MapGridComponent? mapGridComp = null) { var ev = new IsTileAirBlockedMethodEvent(gridUid, tile, directions, mapGridComp); RaiseLocalEvent(gridUid, ref ev); @@ -130,7 +130,7 @@ public partial class AtmosphereSystem return ev.Result; } - public bool IsTileSpace(EntityUid? gridUid, EntityUid? mapUid, Vector2i tile, IMapGridComponent? mapGridComp = null) + public bool IsTileSpace(EntityUid? gridUid, EntityUid? mapUid, Vector2i tile, MapGridComponent? mapGridComp = null) { var ev = new IsTileSpaceMethodEvent(gridUid, mapUid, tile, mapGridComp); @@ -178,7 +178,7 @@ public partial class AtmosphereSystem return ev.Result ?? Enumerable.Empty(); } - public void UpdateAdjacent(EntityUid gridUid, Vector2i tile, IMapGridComponent? mapGridComp = null) + public void UpdateAdjacent(EntityUid gridUid, Vector2i tile, MapGridComponent? mapGridComp = null) { var ev = new UpdateAdjacentMethodEvent(gridUid, tile, mapGridComp); RaiseLocalEvent(gridUid, ref ev); @@ -263,10 +263,10 @@ public partial class AtmosphereSystem (EntityUid GridId, Vector2i Tile, ReactionResult Result = default, bool Handled = false); [ByRefEvent] private record struct IsTileAirBlockedMethodEvent - (EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, IMapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false); + (EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, MapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false); [ByRefEvent] private record struct IsTileSpaceMethodEvent - (EntityUid? Grid, EntityUid? Map, Vector2i Tile, IMapGridComponent? MapGridComponent = null, bool Result = true, bool Handled = false); + (EntityUid? Grid, EntityUid? Map, Vector2i Tile, MapGridComponent? MapGridComponent = null, bool Result = true, bool Handled = false); [ByRefEvent] private record struct GetAdjacentTilesMethodEvent (EntityUid Grid, Vector2i Tile, IEnumerable? Result = null, bool Handled = false); @@ -276,7 +276,7 @@ public partial class AtmosphereSystem IEnumerable? Result = null, bool Handled = false); [ByRefEvent] private record struct UpdateAdjacentMethodEvent - (EntityUid Grid, Vector2i Tile, IMapGridComponent? MapGridComponent = null, bool Handled = false); + (EntityUid Grid, Vector2i Tile, MapGridComponent? MapGridComponent = null, bool Handled = false); [ByRefEvent] private record struct HotspotExposeMethodEvent (EntityUid Grid, Vector2i Tile, float ExposedTemperature, float ExposedVolume, bool soh, bool Handled = false); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs index ac3e831168..c242e915e5 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs @@ -72,7 +72,7 @@ public sealed partial class AtmosphereSystem return; } - if (!TryComp(euid, out IMapGridComponent? gridComp)) + if (!TryComp(euid, out MapGridComponent? gridComp)) { shell.WriteError($"Euid '{euid}' does not exist or is not a grid."); return; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs index 5dcf40525b..6f8ec55389 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs @@ -43,7 +43,7 @@ public sealed partial class AtmosphereSystem { base.Initialize(); - if (!TryComp(uid, out IMapGridComponent? mapGrid)) + if (!TryComp(uid, out MapGridComponent? mapGrid)) return; foreach (var (indices, tile) in gridAtmosphere.Tiles) @@ -324,7 +324,7 @@ public sealed partial class AtmosphereSystem adjacent.BlockedAirflow = GetBlockedDirections(mapGridComp.Grid, adjacent.GridIndices); - // Pass in IMapGridComponent so we don't have to resolve it for every adjacent direction. + // Pass in MapGridComponent so we don't have to resolve it for every adjacent direction. var tileBlockedEv = new IsTileAirBlockedMethodEvent(uid, tile.GridIndices, direction, mapGridComp); GridIsTileAirBlocked(uid, component, ref tileBlockedEv); @@ -418,7 +418,7 @@ public sealed partial class AtmosphereSystem if (!adjEv.Handled || !component.Tiles.TryGetValue(args.Tile, out var tile)) return; - if (!TryComp(uid, out var mapGridComp)) + if (!TryComp(uid, out var mapGridComp)) return; var adjacent = adjEv.Result!.ToArray(); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs index 8d43d0130e..c6b7fc814b 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs @@ -45,7 +45,7 @@ namespace Content.Server.Atmos.EntitySystems var uid = atmosphere.Owner; - if (!TryComp(uid, out IMapGridComponent? mapGridComp)) + if (!TryComp(uid, out MapGridComponent? mapGridComp)) return true; var mapGrid = mapGridComp.Grid; @@ -161,7 +161,7 @@ namespace Content.Server.Atmos.EntitySystems var uid = atmosphere.Owner; - if (!TryComp(uid, out IMapGridComponent? mapGridComp)) + if (!TryComp(uid, out MapGridComponent? mapGridComp)) throw new Exception("Tried to process a grid atmosphere on an entity that isn't a grid!"); var mapGrid = mapGridComp.Grid; diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 240c84e237..7aceb2aaa2 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -402,7 +402,7 @@ public sealed partial class CargoSystem } var offset = 0f; - if (TryComp(orderDatabase.Shuttle, out var shuttleGrid)) + if (TryComp(orderDatabase.Shuttle, out var shuttleGrid)) { var bounds = shuttleGrid.Grid.LocalAABB; offset = MathF.Max(bounds.Width, bounds.Height) / 2f; diff --git a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs index d670000edc..858a2c2914 100644 --- a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs @@ -70,7 +70,7 @@ namespace Content.Server.Chemistry.Components var xform = _entities.GetComponent(Owner); var solSys = _systems.GetEntitySystem(); - if (!_entities.TryGetComponent(xform.GridUid, out IMapGridComponent? gridComp)) + if (!_entities.TryGetComponent(xform.GridUid, out MapGridComponent? gridComp)) return; var grid = gridComp.Grid; diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index 75cffa6270..2fbb6f2f29 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -105,7 +105,7 @@ namespace Content.Server.Chemistry.EntitySystems vapor.ReactTimer += frameTime; - if (vapor.ReactTimer >= ReactTime && TryComp(xform.GridUid, out IMapGridComponent? gridComp)) + if (vapor.ReactTimer >= ReactTime && TryComp(xform.GridUid, out MapGridComponent? gridComp)) { vapor.ReactTimer = 0; diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index d8b6360e14..7153799825 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -511,7 +511,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems } var xform = Transform(component.Owner); - if (!TryComp(xform.GridUid, out IMapGridComponent? grid)) + if (!TryComp(xform.GridUid, out MapGridComponent? grid)) return false; var coords = xform.Coordinates; diff --git a/Content.Server/Dragon/DragonSystem.Rule.cs b/Content.Server/Dragon/DragonSystem.Rule.cs index f56b87bcd8..1324467925 100644 --- a/Content.Server/Dragon/DragonSystem.Rule.cs +++ b/Content.Server/Dragon/DragonSystem.Rule.cs @@ -29,7 +29,7 @@ public sealed partial class DragonSystem public override void Started() { - var spawnLocations = EntityManager.EntityQuery().ToList(); + var spawnLocations = EntityManager.EntityQuery().ToList(); if (spawnLocations.Count == 0) return; diff --git a/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs b/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs index d77d5f9d2b..d14b525d1d 100644 --- a/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs @@ -212,7 +212,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem var susLoot = _prototypeManager.Index(SuspicionLootTable); - foreach (var (_, mapGrid) in EntityManager.EntityQuery(true)) + foreach (var (_, mapGrid) in EntityManager.EntityQuery(true)) { // I'm so sorry. var tiles = mapGrid.Grid.GetAllTiles().ToArray(); diff --git a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs index 58f45916d3..0919b5c8fe 100644 --- a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs +++ b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs @@ -78,7 +78,7 @@ public sealed partial class PathfindingSystem { if (comp.DirtyChunks.Count == 0 || comp.NextUpdate < curTime || - !TryComp(comp.Owner, out var mapGridComp)) + !TryComp(comp.Owner, out var mapGridComp)) { continue; } @@ -237,7 +237,7 @@ public sealed partial class PathfindingSystem { if (!TryComp(ev.Sender, out var body) || body.BodyType != BodyType.Static || - HasComp(ev.Sender) || + HasComp(ev.Sender) || ev.OldPosition.Equals(ev.NewPosition)) { return; diff --git a/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs b/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs index 8f74f71d13..14c2c2b3e2 100644 --- a/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs +++ b/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs @@ -32,7 +32,7 @@ namespace Content.Server.Objectives.Conditions var entMan = IoCManager.Resolve(); - if (!entMan.TryGetComponent(shuttle, out var shuttleGrid) || + if (!entMan.TryGetComponent(shuttle, out var shuttleGrid) || !entMan.TryGetComponent(shuttle, out var shuttleXform)) { return false; diff --git a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs index 2867e3317a..feea4fc4c6 100644 --- a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs +++ b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs @@ -342,7 +342,7 @@ namespace Content.Server.ParticleAccelerator.Components var xform = _entMan.GetComponent(Owner); // Find fuel chamber first by scanning cardinals. - if (xform.Anchored && _entMan.TryGetComponent(xform.GridUid, out IMapGridComponent? grid)) + if (xform.Anchored && _entMan.TryGetComponent(xform.GridUid, out MapGridComponent? grid)) { foreach (var maybeFuel in grid.Grid.GetCardinalNeighborCells(xform.Coordinates)) { diff --git a/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs b/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs index 3c6e01c894..7585b60c27 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs @@ -102,7 +102,7 @@ public partial class RadiationSystem // check if it's on a grid var trs = Transform(uid); - if (!trs.Anchored || !TryComp(trs.GridUid, out IMapGridComponent? grid)) + if (!trs.Anchored || !TryComp(trs.GridUid, out MapGridComponent? grid)) return; // save resistance into rad protection grid diff --git a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs index d14f5ca564..55aa68018c 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs @@ -24,6 +24,7 @@ public partial class RadiationSystem var destinations = EntityQuery(); var resistanceQuery = GetEntityQuery(); var transformQuery = GetEntityQuery(); + var gridQuery = GetEntityQuery(); // precalculate world positions for each source // so we won't need to calc this in cycle over and over again @@ -48,7 +49,7 @@ public partial class RadiationSystem // send ray towards destination entity var ray = Irradiate(sourceTrs.Owner, sourceTrs, sourceWorld, destTrs.Owner, destTrs, destWorld, - source.Intensity, source.Slope, saveVisitedTiles, resistanceQuery, transformQuery); + source.Intensity, source.Slope, saveVisitedTiles, resistanceQuery, transformQuery, gridQuery); if (ray == null) continue; @@ -86,7 +87,7 @@ public partial class RadiationSystem EntityUid destUid, TransformComponent destTrs, Vector2 destWorld, float incomingRads, float slope, bool saveVisitedTiles, EntityQuery resistanceQuery, - EntityQuery transformQuery) + EntityQuery transformQuery, EntityQuery gridQuery) { // lets first check that source and destination on the same map if (sourceTrs.MapID != destTrs.MapID) @@ -115,8 +116,7 @@ public partial class RadiationSystem // however we can do simplification and ignore that case if (GridcastSimplifiedSameGrid && sourceTrs.GridUid != null && sourceTrs.GridUid == destTrs.GridUid) { - // todo: entity queries doesn't support interface - use it when IMapGridComponent will be removed - if (!TryComp(sourceTrs.GridUid.Value, out IMapGridComponent? gridComponent)) + if (!gridQuery.TryGetComponent(sourceTrs.GridUid.Value, out var gridComponent)) return ray; return Gridcast(gridComponent.Grid, ray, saveVisitedTiles, resistanceQuery, sourceTrs, destTrs, transformQuery.GetComponent(sourceTrs.GridUid.Value)); } @@ -169,7 +169,7 @@ public partial class RadiationSystem Vector2 dstLocal = destTrs.ParentUid == grid.GridEntityId ? destTrs.LocalPosition : gridTrs.InvLocalMatrix.Transform(ray.Destination); - + Vector2i sourceGrid = new( (int) Math.Floor(srcLocal.X / grid.TileSize), (int) Math.Floor(srcLocal.Y / grid.TileSize)); diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs index 05f7bf653b..9f2b945676 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs @@ -112,7 +112,7 @@ public sealed partial class ShuttleSystem /// /// Checks whether the emergency shuttle can warp to the specified position. /// - private bool ValidSpawn(IMapGridComponent grid, Box2 area) + private bool ValidSpawn(MapGridComponent grid, Box2 area) { return !grid.Grid.GetLocalTilesIntersecting(area).Any(); } @@ -124,13 +124,13 @@ public sealed partial class ShuttleSystem if (gridDocks.Count <= 0) return null; var xformQuery = GetEntityQuery(); - var targetGridGrid = Comp(targetGrid); + var targetGridGrid = Comp(targetGrid); var targetGridXform = xformQuery.GetComponent(targetGrid); var targetGridAngle = targetGridXform.WorldRotation.Reduced(); var targetGridRotation = targetGridAngle.ToVec(); var shuttleDocks = GetDocks(component.Owner); - var shuttleAABB = Comp(component.Owner).Grid.LocalAABB; + var shuttleAABB = Comp(component.Owner).Grid.LocalAABB; var validDockConfigs = new List(); @@ -310,7 +310,7 @@ public sealed partial class ShuttleSystem TransformComponent gridXform, Vector2 targetGridRotation, Box2 shuttleAABB, - IMapGridComponent grid, + MapGridComponent grid, [NotNullWhen(true)] out Box2? shuttleDockedAABB, out Matrix3 matty, out Vector2 gridRotation) diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index d6f34a6d05..c476fbbf09 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -89,7 +89,7 @@ public sealed partial class ShuttleSystem { reason = null; - if (!TryComp(uid, out var grid) || + if (!TryComp(uid, out var grid) || !Resolve(uid.Value, ref xform)) { return true; @@ -226,7 +226,7 @@ public sealed partial class ShuttleSystem comp.State = FTLState.Travelling; - var width = Comp(comp.Owner).Grid.LocalAABB.Width; + var width = Comp(comp.Owner).Grid.LocalAABB.Width; xform.Coordinates = new EntityCoordinates(_mapManager.GetMapEntityId(_hyperSpaceMap!.Value), new Vector2(_index + width / 2f, 0f)); xform.LocalRotation = Angle.Zero; _index += width + Buffer; @@ -458,13 +458,13 @@ public sealed partial class ShuttleSystem } var xformQuery = GetEntityQuery(); - var shuttleAABB = Comp(component.Owner).Grid.LocalAABB; + var shuttleAABB = Comp(component.Owner).Grid.LocalAABB; // Spawn nearby. // We essentially expand the Box2 of the target area until nothing else is added then we know it's valid. // Can't just get an AABB of every grid as we may spawn very far away. var targetAABB = _transform.GetWorldMatrix(targetXform, xformQuery) - .TransformBox(Comp(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length); + .TransformBox(Comp(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length); var nearbyGrids = new HashSet(1) { targetUid }; var iteration = 0; @@ -478,7 +478,7 @@ public sealed partial class ShuttleSystem if (!nearbyGrids.Add(grid.GridEntityId)) continue; targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery) - .TransformBox(Comp(grid.GridEntityId).Grid.LocalAABB)); + .TransformBox(Comp(grid.GridEntityId).Grid.LocalAABB)); } // Can do proximity @@ -501,7 +501,7 @@ public sealed partial class ShuttleSystem if (nearbyGrids.Contains(grid.GridEntityId)) continue; targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery) - .TransformBox(Comp(grid.GridEntityId).Grid.LocalAABB)); + .TransformBox(Comp(grid.GridEntityId).Grid.LocalAABB)); } break; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index 4d8312d852..a5ee6eee4f 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -102,7 +102,7 @@ namespace Content.Server.Shuttles.Systems private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args) { - if (!EntityManager.HasComponent(component.Owner)) + if (!EntityManager.HasComponent(component.Owner)) { return; } diff --git a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs index 37c0e44178..8b03187d15 100644 --- a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs @@ -130,7 +130,7 @@ namespace Content.Server.Singularity.EntitySystems private bool CanDestroy(SharedSingularityComponent component, EntityUid entity) { return entity != component.Owner && - !EntityManager.HasComponent(entity) && + !EntityManager.HasComponent(entity) && !EntityManager.HasComponent(entity) && !EntityManager.HasComponent(entity) && // these SHOULD be in null-space... but just in case. Also, maybe someone moves a singularity there.. (component.Level > 4 || @@ -180,7 +180,7 @@ namespace Content.Server.Singularity.EntitySystems private bool CanPull(EntityUid entity) { return !(EntityManager.HasComponent(entity) || - EntityManager.HasComponent(entity) || + EntityManager.HasComponent(entity) || EntityManager.HasComponent(entity) || EntityManager.HasComponent(entity) || _container.IsEntityInContainer(entity)); diff --git a/Content.Server/Station/Systems/StationSystem.cs b/Content.Server/Station/Systems/StationSystem.cs index a744ee3600..d9750f53c9 100644 --- a/Content.Server/Station/Systems/StationSystem.cs +++ b/Content.Server/Station/Systems/StationSystem.cs @@ -242,7 +242,7 @@ public sealed class StationSystem : EntitySystem foreach (var gridUid in component.Grids) { - if (!TryComp(gridUid, out var grid) || + if (!TryComp(gridUid, out var grid) || grid.Grid.LocalAABB.Size.LengthSquared < largestBounds.Size.LengthSquared) continue; @@ -385,7 +385,7 @@ public sealed class StationSystem : EntitySystem /// Resolve pattern, station data component of station. /// The name to assign to the grid if any. /// Thrown when mapGrid or station are not a grid or station, respectively. - public void AddGridToStation(EntityUid station, EntityUid mapGrid, IMapGridComponent? gridComponent = null, StationDataComponent? stationData = null, string? name = null) + public void AddGridToStation(EntityUid station, EntityUid mapGrid, MapGridComponent? gridComponent = null, StationDataComponent? stationData = null, string? name = null) { if (!Resolve(mapGrid, ref gridComponent)) throw new ArgumentException("Tried to initialize a station on a non-grid entity!", nameof(mapGrid)); @@ -412,7 +412,7 @@ public sealed class StationSystem : EntitySystem /// Resolve pattern, grid component of mapGrid. /// Resolve pattern, station data component of station. /// Thrown when mapGrid or station are not a grid or station, respectively. - public void RemoveGridFromStation(EntityUid station, EntityUid mapGrid, IMapGridComponent? gridComponent = null, StationDataComponent? stationData = null) + public void RemoveGridFromStation(EntityUid station, EntityUid mapGrid, MapGridComponent? gridComponent = null, StationDataComponent? stationData = null) { if (!Resolve(mapGrid, ref gridComponent)) throw new ArgumentException("Tried to initialize a station on a non-grid entity!", nameof(mapGrid)); @@ -487,7 +487,7 @@ public sealed class StationSystem : EntitySystem return entity; } - if (TryComp(entity, out _)) + if (TryComp(entity, out _)) { // We are the station, just check ourselves. return CompOrNull(entity)?.Station; diff --git a/Content.Server/StationEvents/Events/StationEventSystem.cs b/Content.Server/StationEvents/Events/StationEventSystem.cs index 24675adfc5..1da3e2c4bd 100644 --- a/Content.Server/StationEvents/Events/StationEventSystem.cs +++ b/Content.Server/StationEvents/Events/StationEventSystem.cs @@ -145,7 +145,7 @@ namespace Content.Server.StationEvents.Events targetGrid = RobustRandom.Pick(possibleTargets); - if (!TryComp(targetGrid, out var gridComp)) + if (!TryComp(targetGrid, out var gridComp)) return false; var grid = gridComp.Grid; diff --git a/Content.Server/Tabletop/TabletopSystem.Map.cs b/Content.Server/Tabletop/TabletopSystem.Map.cs index a3dea3719b..fddf83c26f 100644 --- a/Content.Server/Tabletop/TabletopSystem.Map.cs +++ b/Content.Server/Tabletop/TabletopSystem.Map.cs @@ -49,7 +49,7 @@ namespace Content.Server.Tabletop TabletopMap = _mapManager.CreateMap(); _tabletops = 0; - var mapComp = EntityManager.GetComponent(_mapManager.GetMapEntityId(TabletopMap)); + var mapComp = EntityManager.GetComponent(_mapManager.GetMapEntityId(TabletopMap)); // Lighting is always disabled in tabletop world. mapComp.LightingEnabled = false; diff --git a/Content.Shared/Singularity/SharedSingularitySystem.cs b/Content.Shared/Singularity/SharedSingularitySystem.cs index bf3d5868ce..b1c66ebbd9 100644 --- a/Content.Shared/Singularity/SharedSingularitySystem.cs +++ b/Content.Shared/Singularity/SharedSingularitySystem.cs @@ -65,7 +65,7 @@ namespace Content.Shared.Singularity var otherUid = args.BodyB.Owner; // For prediction reasons always want the client to ignore these. - if (EntityManager.HasComponent(otherUid) || + if (EntityManager.HasComponent(otherUid) || EntityManager.HasComponent(otherUid)) { args.Cancelled = true;