Code Cleanup: Purge obsolete MapManager methods (#26279)
* GetGrid * GridExists * TryGetGrid
This commit is contained in:
@@ -492,7 +492,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
centcomm.ShuttleIndex += _mapManager.GetGrid(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer;
|
||||
centcomm.ShuttleIndex += Comp<MapGridComponent>(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer;
|
||||
|
||||
// Update indices for all centcomm comps pointing to same map
|
||||
var query = AllEntityQuery<StationCentcommComponent>();
|
||||
|
||||
@@ -559,7 +559,7 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
private float GetSoundRange(EntityUid uid)
|
||||
{
|
||||
if (!_mapManager.TryGetGrid(uid, out var grid))
|
||||
if (!TryComp<MapGridComponent>(uid, out var grid))
|
||||
return 4f;
|
||||
|
||||
return MathF.Max(grid.LocalAABB.Width, grid.LocalAABB.Height) + 12.5f;
|
||||
|
||||
@@ -12,6 +12,7 @@ using Content.Shared.Physics;
|
||||
using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Temperature;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Events;
|
||||
@@ -95,7 +96,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
return;
|
||||
|
||||
var tilePos = args.NewTile.GridIndices;
|
||||
var grid = _mapManager.GetGrid(uid);
|
||||
var grid = Comp<MapGridComponent>(uid);
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var thrusterQuery = GetEntityQuery<ThrusterComponent>();
|
||||
|
||||
@@ -436,7 +437,7 @@ public sealed class ThrusterSystem : EntitySystem
|
||||
return true;
|
||||
|
||||
var (x, y) = xform.LocalPosition + xform.LocalRotation.Opposite().ToWorldVec();
|
||||
var tile = _mapManager.GetGrid(xform.GridUid.Value).GetTileRef(new Vector2i((int) Math.Floor(x), (int) Math.Floor(y)));
|
||||
var tile = Comp<MapGridComponent>(xform.GridUid.Value).GetTileRef(new Vector2i((int) Math.Floor(x), (int) Math.Floor(y)));
|
||||
|
||||
return tile.Tile.IsSpace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user