Cleanup remaining warnings in ExplosionSystem (#37764)
* Change ExplosionGridTileFlood.Grid to Entity<T> * Change ExplosionData.Lookup to Entity<T> * ExplodeSpace * ExplosionData.MapGrid * _currentGrid * _tileUpdateDict * 1 warning in Process * IsEdge
This commit is contained in:
@@ -31,7 +31,7 @@ public sealed partial class ExplosionSystem
|
||||
|
||||
foreach (var tileRef in _map.GetAllTiles(ev.EntityUid, grid))
|
||||
{
|
||||
if (IsEdge(grid, tileRef.GridIndices, out var dir))
|
||||
if (IsEdge((ev.EntityUid, grid), tileRef.GridIndices, out var dir))
|
||||
edges.Add(tileRef.GridIndices, dir);
|
||||
}
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public sealed partial class ExplosionSystem
|
||||
}
|
||||
|
||||
// finally check if the new tile is itself an edge tile
|
||||
if (IsEdge(grid, change.GridIndices, out var spaceDir))
|
||||
if (IsEdge((ev.Entity, grid), change.GridIndices, out var spaceDir))
|
||||
edges.Add(change.GridIndices, spaceDir);
|
||||
}
|
||||
}
|
||||
@@ -302,12 +302,12 @@ public sealed partial class ExplosionSystem
|
||||
/// Optionally ignore a specific Vector2i. Used by <see cref="OnTileChanged"/> when we already know that a
|
||||
/// given tile is not space. This avoids unnecessary TryGetTileRef calls.
|
||||
/// </remarks>
|
||||
private bool IsEdge(MapGridComponent grid, Vector2i index, out NeighborFlag spaceDirections)
|
||||
private bool IsEdge(Entity<MapGridComponent> grid, Vector2i index, out NeighborFlag spaceDirections)
|
||||
{
|
||||
spaceDirections = NeighborFlag.Invalid;
|
||||
for (var i = 0; i < NeighbourVectors.Length; i++)
|
||||
{
|
||||
if (!grid.TryGetTileRef(index + NeighbourVectors[i], out var neighborTile) || neighborTile.Tile.IsEmpty)
|
||||
if (!_mapSystem.TryGetTileRef(grid, grid.Comp, index + NeighbourVectors[i], out var neighborTile) || neighborTile.Tile.IsEmpty)
|
||||
spaceDirections |= (NeighborFlag) (1 << i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user