Content side for removing IMap / IMapGrid comps (#12357)
This commit is contained in:
@@ -42,8 +42,8 @@ public sealed partial class ObjectsTab : Control
|
||||
var entities = selection switch
|
||||
{
|
||||
ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations.ToList(),
|
||||
ObjectsTabSelection.Grids => _entityManager.EntityQuery<IMapGridComponent>(true).Select(x => x.Owner).ToList(),
|
||||
ObjectsTabSelection.Maps => _entityManager.EntityQuery<IMapComponent>(true).Select(x => x.Owner).ToList(),
|
||||
ObjectsTabSelection.Grids => _entityManager.EntityQuery<MapGridComponent>(true).Select(x => x.Owner).ToList(),
|
||||
ObjectsTabSelection.Maps => _entityManager.EntityQuery<MapComponent>(true).Select(x => x.Owner).ToList(),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null)
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -87,7 +87,7 @@ public sealed partial class AdminVerbSystem
|
||||
return;
|
||||
|
||||
// 1984.
|
||||
if (HasComp<IMapComponent>(args.Target) || HasComp<IMapGridComponent>(args.Target))
|
||||
if (HasComp<MapComponent>(args.Target) || HasComp<MapGridComponent>(args.Target))
|
||||
return;
|
||||
|
||||
Verb explode = new()
|
||||
|
||||
@@ -687,7 +687,7 @@ public sealed partial class AdminVerbSystem
|
||||
args.Verbs.Add(haltMovement);
|
||||
}
|
||||
|
||||
if (TryComp<IMapComponent>(args.Target, out var map))
|
||||
if (TryComp<MapComponent>(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<EntityUid>? enumerator)
|
||||
{
|
||||
if (!HasComp<IMapComponent>(target) && !HasComp<IMapGridComponent>(target) &&
|
||||
if (!HasComp<MapComponent>(target) && !HasComp<MapGridComponent>(target) &&
|
||||
!HasComp<StationDataComponent>(target))
|
||||
{
|
||||
enumerator = null;
|
||||
@@ -827,7 +827,7 @@ public sealed partial class AdminVerbSystem
|
||||
yield break;
|
||||
}
|
||||
|
||||
else if (HasComp<IMapComponent>(target))
|
||||
else if (HasComp<MapComponent>(target))
|
||||
{
|
||||
foreach (var possibleGrid in Transform(target).ChildEntities)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.Atmos.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entMan.HasComponent<IMapGridComponent>(euid))
|
||||
if (!entMan.HasComponent<MapGridComponent>(euid))
|
||||
{
|
||||
shell.WriteError($"Euid '{euid}' does not exist or is not a grid.");
|
||||
return;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.Atmos.Commands
|
||||
|| !float.TryParse(args[4], out var moles)) return;
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entMan.HasComponent<IMapGridComponent>(euid))
|
||||
if (!entMan.HasComponent<MapGridComponent>(euid))
|
||||
{
|
||||
shell.WriteError($"Euid '{euid}' does not exist or is not a grid.");
|
||||
return;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<GasMixture>();
|
||||
}
|
||||
|
||||
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<Vector2i>? Result = null, bool Handled = false);
|
||||
@@ -276,7 +276,7 @@ public partial class AtmosphereSystem
|
||||
IEnumerable<GasMixture>? 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<IMapGridComponent>(uid, out var mapGridComp))
|
||||
if (!TryComp<MapGridComponent>(uid, out var mapGridComp))
|
||||
return;
|
||||
|
||||
var adjacent = adjEv.Result!.ToArray();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -402,7 +402,7 @@ public sealed partial class CargoSystem
|
||||
}
|
||||
|
||||
var offset = 0f;
|
||||
if (TryComp<IMapGridComponent>(orderDatabase.Shuttle, out var shuttleGrid))
|
||||
if (TryComp<MapGridComponent>(orderDatabase.Shuttle, out var shuttleGrid))
|
||||
{
|
||||
var bounds = shuttleGrid.Grid.LocalAABB;
|
||||
offset = MathF.Max(bounds.Width, bounds.Height) / 2f;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Content.Server.Chemistry.Components
|
||||
var xform = _entities.GetComponent<TransformComponent>(Owner);
|
||||
var solSys = _systems.GetEntitySystem<SolutionContainerSystem>();
|
||||
|
||||
if (!_entities.TryGetComponent(xform.GridUid, out IMapGridComponent? gridComp))
|
||||
if (!_entities.TryGetComponent(xform.GridUid, out MapGridComponent? gridComp))
|
||||
return;
|
||||
|
||||
var grid = gridComp.Grid;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -29,7 +29,7 @@ public sealed partial class DragonSystem
|
||||
|
||||
public override void Started()
|
||||
{
|
||||
var spawnLocations = EntityManager.EntityQuery<IMapGridComponent, TransformComponent>().ToList();
|
||||
var spawnLocations = EntityManager.EntityQuery<MapGridComponent, TransformComponent>().ToList();
|
||||
|
||||
if (spawnLocations.Count == 0)
|
||||
return;
|
||||
|
||||
@@ -212,7 +212,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
|
||||
var susLoot = _prototypeManager.Index<EntityLootTablePrototype>(SuspicionLootTable);
|
||||
|
||||
foreach (var (_, mapGrid) in EntityManager.EntityQuery<StationMemberComponent, IMapGridComponent>(true))
|
||||
foreach (var (_, mapGrid) in EntityManager.EntityQuery<StationMemberComponent, MapGridComponent>(true))
|
||||
{
|
||||
// I'm so sorry.
|
||||
var tiles = mapGrid.Grid.GetAllTiles().ToArray();
|
||||
|
||||
@@ -78,7 +78,7 @@ public sealed partial class PathfindingSystem
|
||||
{
|
||||
if (comp.DirtyChunks.Count == 0 ||
|
||||
comp.NextUpdate < curTime ||
|
||||
!TryComp<IMapGridComponent>(comp.Owner, out var mapGridComp))
|
||||
!TryComp<MapGridComponent>(comp.Owner, out var mapGridComp))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -237,7 +237,7 @@ public sealed partial class PathfindingSystem
|
||||
{
|
||||
if (!TryComp<PhysicsComponent>(ev.Sender, out var body) ||
|
||||
body.BodyType != BodyType.Static ||
|
||||
HasComp<IMapGridComponent>(ev.Sender) ||
|
||||
HasComp<MapGridComponent>(ev.Sender) ||
|
||||
ev.OldPosition.Equals(ev.NewPosition))
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!entMan.TryGetComponent<IMapGridComponent>(shuttle, out var shuttleGrid) ||
|
||||
if (!entMan.TryGetComponent<MapGridComponent>(shuttle, out var shuttleGrid) ||
|
||||
!entMan.TryGetComponent<TransformComponent>(shuttle, out var shuttleXform))
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace Content.Server.ParticleAccelerator.Components
|
||||
var xform = _entMan.GetComponent<TransformComponent>(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))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,6 +24,7 @@ public partial class RadiationSystem
|
||||
var destinations = EntityQuery<RadiationReceiverComponent, TransformComponent>();
|
||||
var resistanceQuery = GetEntityQuery<RadiationGridResistanceComponent>();
|
||||
var transformQuery = GetEntityQuery<TransformComponent>();
|
||||
var gridQuery = GetEntityQuery<MapGridComponent>();
|
||||
|
||||
// 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<RadiationGridResistanceComponent> resistanceQuery,
|
||||
EntityQuery<TransformComponent> transformQuery)
|
||||
EntityQuery<TransformComponent> transformQuery, EntityQuery<MapGridComponent> 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));
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public sealed partial class ShuttleSystem
|
||||
/// <summary>
|
||||
/// Checks whether the emergency shuttle can warp to the specified position.
|
||||
/// </summary>
|
||||
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<TransformComponent>();
|
||||
var targetGridGrid = Comp<IMapGridComponent>(targetGrid);
|
||||
var targetGridGrid = Comp<MapGridComponent>(targetGrid);
|
||||
var targetGridXform = xformQuery.GetComponent(targetGrid);
|
||||
var targetGridAngle = targetGridXform.WorldRotation.Reduced();
|
||||
var targetGridRotation = targetGridAngle.ToVec();
|
||||
|
||||
var shuttleDocks = GetDocks(component.Owner);
|
||||
var shuttleAABB = Comp<IMapGridComponent>(component.Owner).Grid.LocalAABB;
|
||||
var shuttleAABB = Comp<MapGridComponent>(component.Owner).Grid.LocalAABB;
|
||||
|
||||
var validDockConfigs = new List<DockingConfig>();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -89,7 +89,7 @@ public sealed partial class ShuttleSystem
|
||||
{
|
||||
reason = null;
|
||||
|
||||
if (!TryComp<IMapGridComponent>(uid, out var grid) ||
|
||||
if (!TryComp<MapGridComponent>(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<IMapGridComponent>(comp.Owner).Grid.LocalAABB.Width;
|
||||
var width = Comp<MapGridComponent>(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<TransformComponent>();
|
||||
var shuttleAABB = Comp<IMapGridComponent>(component.Owner).Grid.LocalAABB;
|
||||
var shuttleAABB = Comp<MapGridComponent>(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<IMapGridComponent>(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length);
|
||||
.TransformBox(Comp<MapGridComponent>(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length);
|
||||
|
||||
var nearbyGrids = new HashSet<EntityUid>(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<IMapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
|
||||
.TransformBox(Comp<MapGridComponent>(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<IMapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
|
||||
.TransformBox(Comp<MapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Content.Server.Shuttles.Systems
|
||||
|
||||
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
|
||||
{
|
||||
if (!EntityManager.HasComponent<IMapGridComponent>(component.Owner))
|
||||
if (!EntityManager.HasComponent<MapGridComponent>(component.Owner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
private bool CanDestroy(SharedSingularityComponent component, EntityUid entity)
|
||||
{
|
||||
return entity != component.Owner &&
|
||||
!EntityManager.HasComponent<IMapGridComponent>(entity) &&
|
||||
!EntityManager.HasComponent<MapGridComponent>(entity) &&
|
||||
!EntityManager.HasComponent<GhostComponent>(entity) &&
|
||||
!EntityManager.HasComponent<StationDataComponent>(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<GhostComponent>(entity) ||
|
||||
EntityManager.HasComponent<IMapGridComponent>(entity) ||
|
||||
EntityManager.HasComponent<MapGridComponent>(entity) ||
|
||||
EntityManager.HasComponent<MapComponent>(entity) ||
|
||||
EntityManager.HasComponent<ServerSingularityComponent>(entity) ||
|
||||
_container.IsEntityInContainer(entity));
|
||||
|
||||
@@ -242,7 +242,7 @@ public sealed class StationSystem : EntitySystem
|
||||
|
||||
foreach (var gridUid in component.Grids)
|
||||
{
|
||||
if (!TryComp<IMapGridComponent>(gridUid, out var grid) ||
|
||||
if (!TryComp<MapGridComponent>(gridUid, out var grid) ||
|
||||
grid.Grid.LocalAABB.Size.LengthSquared < largestBounds.Size.LengthSquared)
|
||||
continue;
|
||||
|
||||
@@ -385,7 +385,7 @@ public sealed class StationSystem : EntitySystem
|
||||
/// <param name="stationData">Resolve pattern, station data component of station.</param>
|
||||
/// <param name="name">The name to assign to the grid if any.</param>
|
||||
/// <exception cref="ArgumentException">Thrown when mapGrid or station are not a grid or station, respectively.</exception>
|
||||
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
|
||||
/// <param name="gridComponent">Resolve pattern, grid component of mapGrid.</param>
|
||||
/// <param name="stationData">Resolve pattern, station data component of station.</param>
|
||||
/// <exception cref="ArgumentException">Thrown when mapGrid or station are not a grid or station, respectively.</exception>
|
||||
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<IMapGridComponent>(entity, out _))
|
||||
if (TryComp<MapGridComponent>(entity, out _))
|
||||
{
|
||||
// We are the station, just check ourselves.
|
||||
return CompOrNull<StationMemberComponent>(entity)?.Station;
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Content.Server.StationEvents.Events
|
||||
|
||||
targetGrid = RobustRandom.Pick(possibleTargets);
|
||||
|
||||
if (!TryComp<IMapGridComponent>(targetGrid, out var gridComp))
|
||||
if (!TryComp<MapGridComponent>(targetGrid, out var gridComp))
|
||||
return false;
|
||||
|
||||
var grid = gridComp.Grid;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Content.Server.Tabletop
|
||||
TabletopMap = _mapManager.CreateMap();
|
||||
_tabletops = 0;
|
||||
|
||||
var mapComp = EntityManager.GetComponent<IMapComponent>(_mapManager.GetMapEntityId(TabletopMap));
|
||||
var mapComp = EntityManager.GetComponent<MapComponent>(_mapManager.GetMapEntityId(TabletopMap));
|
||||
|
||||
// Lighting is always disabled in tabletop world.
|
||||
mapComp.LightingEnabled = false;
|
||||
|
||||
@@ -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<IMapGridComponent>(otherUid) ||
|
||||
if (EntityManager.HasComponent<MapGridComponent>(otherUid) ||
|
||||
EntityManager.HasComponent<SharedGhostComponent>(otherUid))
|
||||
{
|
||||
args.Cancelled = true;
|
||||
|
||||
Reference in New Issue
Block a user