Remove Explicit GridId References (#8315)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Acruid
2022-06-11 18:54:41 -07:00
committed by GitHub
parent 846321cebb
commit 4f9be42f40
131 changed files with 531 additions and 588 deletions

View File

@@ -103,7 +103,7 @@ namespace Content.Server.Shuttles.EntitySystems
if (e.NewTile.IsSpace(_tileDefManager) || !e.OldTile.IsSpace(_tileDefManager)) return;
var tilePos = e.NewTile.GridIndices;
var grid = _mapManager.GetGrid(e.NewTile.GridIndex);
var grid = _mapManager.GetGrid(e.NewTile.GridUid);
var xformQuery = GetEntityQuery<TransformComponent>();
var thrusterQuery = GetEntityQuery<ThrusterComponent>();
@@ -126,7 +126,7 @@ namespace Content.Server.Shuttles.EntitySystems
if (new Vector2i((int) direction.X, (int) direction.Y) != new Vector2i(x, y)) continue;
DisableThruster(ent.Value, thruster, xform.GridID);
DisableThruster(ent.Value, thruster, xform.GridEntityId);
}
}
}
@@ -147,7 +147,7 @@ namespace Content.Server.Shuttles.EntitySystems
if (!component.Enabled ||
component.Type != ThrusterType.Linear ||
!EntityManager.TryGetComponent(uid, out TransformComponent? xform) ||
!_mapManager.TryGetGrid(xform.GridID, out var grid) ||
!_mapManager.TryGetGrid(xform.GridEntityId, out var grid) ||
!EntityManager.TryGetComponent(grid.GridEntityId, out ShuttleComponent? shuttleComponent))
{
return;
@@ -243,7 +243,7 @@ namespace Content.Server.Shuttles.EntitySystems
{
if (component.IsOn ||
!Resolve(uid, ref xform) ||
!_mapManager.TryGetGrid(xform.GridID, out var grid)) return;
!_mapManager.TryGetGrid(xform.GridEntityId, out var grid)) return;
component.IsOn = true;
@@ -304,13 +304,13 @@ namespace Content.Server.Shuttles.EntitySystems
public void DisableThruster(EntityUid uid, ThrusterComponent component, TransformComponent? xform = null, Angle? angle = null)
{
if (!Resolve(uid, ref xform)) return;
DisableThruster(uid, component, xform.GridID, xform);
DisableThruster(uid, component, xform.GridEntityId, xform);
}
/// <summary>
/// Tries to disable the thruster.
/// </summary>
public void DisableThruster(EntityUid uid, ThrusterComponent component, GridId gridId, TransformComponent? xform = null, Angle? angle = null)
public void DisableThruster(EntityUid uid, ThrusterComponent component, EntityUid gridId, TransformComponent? xform = null, Angle? angle = null)
{
if (!component.IsOn ||
!Resolve(uid, ref xform) ||
@@ -383,7 +383,7 @@ namespace Content.Server.Shuttles.EntitySystems
private bool NozzleExposed(TransformComponent xform)
{
var (x, y) = xform.LocalPosition + xform.LocalRotation.Opposite().ToWorldVec();
var tile = _mapManager.GetGrid(xform.GridID).GetTileRef(new Vector2i((int) Math.Floor(x), (int) Math.Floor(y)));
var tile = _mapManager.GetGrid(xform.GridEntityId).GetTileRef(new Vector2i((int) Math.Floor(x), (int) Math.Floor(y)));
return tile.Tile.IsSpace();
}