Code Cleanup: Purge obsolete MapManager methods (#26279)
* GetGrid * GridExists * TryGetGrid
This commit is contained in:
@@ -4,7 +4,6 @@ using Content.Shared.Atmos;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Explosion;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
namespace Content.Server.Explosion.EntitySystems;
|
||||
@@ -102,7 +101,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
if (!EntityManager.TryGetComponent(uid, out TransformComponent? transform) || !transform.Anchored)
|
||||
return;
|
||||
|
||||
if (!_mapManager.TryGetGrid(transform.GridUid, out var grid))
|
||||
if (!TryComp<MapGridComponent>(transform.GridUid, out var grid))
|
||||
return;
|
||||
|
||||
UpdateAirtightMap(transform.GridUid.Value, grid, grid.CoordinatesToTile(transform.Coordinates));
|
||||
|
||||
@@ -23,7 +23,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
/// </summary>
|
||||
private void OnGridStartup(GridStartupEvent ev)
|
||||
{
|
||||
var grid = _mapManager.GetGrid(ev.EntityUid);
|
||||
var grid = Comp<MapGridComponent>(ev.EntityUid);
|
||||
|
||||
Dictionary<Vector2i, NeighborFlag> edges = new();
|
||||
_gridEdges[ev.EntityUid] = edges;
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Administration;
|
||||
using Content.Shared.Explosion;
|
||||
using Content.Shared.Explosion.Components;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -56,7 +57,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
else if (referenceGrid != null)
|
||||
{
|
||||
// reference grid defines coordinate system that the explosion in space will use
|
||||
initialTile = _mapManager.GetGrid(referenceGrid.Value).WorldToTile(epicenter.Position);
|
||||
initialTile = Comp<MapGridComponent>(referenceGrid.Value).WorldToTile(epicenter.Position);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,7 +88,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
var spaceAngle = Angle.Zero;
|
||||
if (referenceGrid != null)
|
||||
{
|
||||
var xform = Transform(_mapManager.GetGrid(referenceGrid.Value).Owner);
|
||||
var xform = Transform(Comp<MapGridComponent>(referenceGrid.Value).Owner);
|
||||
spaceMatrix = xform.WorldMatrix;
|
||||
spaceAngle = xform.WorldRotation;
|
||||
}
|
||||
@@ -102,7 +103,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
airtightMap = new();
|
||||
|
||||
var initialGridData = new ExplosionGridTileFlood(
|
||||
_mapManager.GetGrid(epicentreGrid.Value),
|
||||
Comp<MapGridComponent>(epicentreGrid.Value),
|
||||
airtightMap,
|
||||
maxIntensity,
|
||||
stepSize,
|
||||
@@ -191,7 +192,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
airtightMap = new();
|
||||
|
||||
data = new ExplosionGridTileFlood(
|
||||
_mapManager.GetGrid(grid),
|
||||
Comp<MapGridComponent>(grid),
|
||||
airtightMap,
|
||||
maxIntensity,
|
||||
stepSize,
|
||||
|
||||
Reference in New Issue
Block a user