Replace obsolete Tile Access methods (#32508)
* Replace obsolete SetTile * Remove obsolete GetTileRef & GetAllTiles * Forgor * Apply suggested `GetMapOrInvalid`
This commit is contained in:
@@ -29,7 +29,7 @@ public sealed partial class ExplosionSystem
|
||||
Dictionary<Vector2i, NeighborFlag> edges = new();
|
||||
_gridEdges[ev.EntityUid] = edges;
|
||||
|
||||
foreach (var tileRef in grid.GetAllTiles())
|
||||
foreach (var tileRef in _map.GetAllTiles(ev.EntityUid, grid))
|
||||
{
|
||||
if (IsEdge(grid, tileRef.GridIndices, out var dir))
|
||||
edges.Add(tileRef.GridIndices, dir);
|
||||
|
||||
@@ -666,6 +666,7 @@ sealed class Explosion
|
||||
|
||||
private readonly IEntityManager _entMan;
|
||||
private readonly ExplosionSystem _system;
|
||||
private readonly SharedMapSystem _mapSystem;
|
||||
|
||||
public readonly EntityUid VisualEnt;
|
||||
|
||||
@@ -688,11 +689,13 @@ sealed class Explosion
|
||||
IEntityManager entMan,
|
||||
IMapManager mapMan,
|
||||
EntityUid visualEnt,
|
||||
EntityUid? cause)
|
||||
EntityUid? cause,
|
||||
SharedMapSystem mapSystem)
|
||||
{
|
||||
VisualEnt = visualEnt;
|
||||
Cause = cause;
|
||||
_system = system;
|
||||
_mapSystem = mapSystem;
|
||||
ExplosionType = explosionType;
|
||||
_tileSetIntensity = tileSetIntensity;
|
||||
Epicenter = epicenter;
|
||||
@@ -899,7 +902,7 @@ sealed class Explosion
|
||||
{
|
||||
if (list.Count > 0 && _entMan.EntityExists(grid.Owner))
|
||||
{
|
||||
grid.SetTiles(list);
|
||||
_mapSystem.SetTiles(grid.Owner, grid, list);
|
||||
}
|
||||
}
|
||||
_tileUpdateDict.Clear();
|
||||
|
||||
@@ -389,7 +389,8 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
|
||||
EntityManager,
|
||||
_mapManager,
|
||||
visualEnt,
|
||||
queued.Cause);
|
||||
queued.Cause,
|
||||
_map);
|
||||
}
|
||||
|
||||
private void CameraShake(float range, MapCoordinates epicenter, float totalIntensity)
|
||||
|
||||
Reference in New Issue
Block a user