Remove Explicit GridId References (#8315)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -33,9 +33,9 @@ namespace Content.Client.IconSmoothing
|
||||
var xform = Transform(uid);
|
||||
if (xform.Anchored)
|
||||
{
|
||||
component.LastPosition = _mapManager.TryGetGrid(xform.GridID, out var grid)
|
||||
? (xform.GridID, grid.TileIndicesFor(xform.Coordinates))
|
||||
: (GridId.Invalid, new Vector2i(0, 0));
|
||||
component.LastPosition = _mapManager.TryGetGrid(xform.GridEntityId, out var grid)
|
||||
? (xform.GridEntityId, grid.TileIndicesFor(xform.Coordinates))
|
||||
: (EntityUid.Invalid, new Vector2i(0, 0));
|
||||
|
||||
DirtyNeighbours(uid, component);
|
||||
}
|
||||
@@ -111,14 +111,14 @@ namespace Content.Client.IconSmoothing
|
||||
|
||||
Vector2i pos;
|
||||
|
||||
if (transform.Anchored && _mapManager.TryGetGrid(transform.GridID, out var grid))
|
||||
if (transform.Anchored && _mapManager.TryGetGrid(transform.GridEntityId, out var grid))
|
||||
{
|
||||
pos = grid.CoordinatesToTile(transform.Coordinates);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Entity is no longer valid, update around the last position it was at.
|
||||
if (comp.LastPosition is not (GridId gridId, Vector2i oldPos))
|
||||
if (comp.LastPosition is not (EntityUid gridId, Vector2i oldPos))
|
||||
return;
|
||||
|
||||
if (!_mapManager.TryGetGrid(gridId, out grid))
|
||||
@@ -191,9 +191,9 @@ namespace Content.Client.IconSmoothing
|
||||
|
||||
if (xform.Anchored)
|
||||
{
|
||||
if (!_mapManager.TryGetGrid(xform.GridID, out grid))
|
||||
if (!_mapManager.TryGetGrid(xform.GridEntityId, out grid))
|
||||
{
|
||||
Logger.Error($"Failed to calculate IconSmoothComponent sprite in {uid} because grid {xform.GridID} was missing.");
|
||||
Logger.Error($"Failed to calculate IconSmoothComponent sprite in {uid} because grid {xform.GridEntityId} was missing.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user