Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -18,6 +18,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
||||
[Dependency] private readonly IOverlayManager _overlayManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly AudioSystem _audio = default!;
|
||||
[Dependency] private readonly MapSystem _mapSystem = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
@@ -76,8 +77,9 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
||||
// Work out tiles nearby to determine volume.
|
||||
if (TryComp<MapGridComponent>(entXform.GridUid, out var grid))
|
||||
{
|
||||
var gridId = entXform.GridUid.Value;
|
||||
// Floodfill to the nearest tile and use that for audio.
|
||||
var seed = grid.GetTileRef(entXform.Coordinates);
|
||||
var seed = _mapSystem.GetTileRef(gridId, grid, entXform.Coordinates);
|
||||
var frontier = new Queue<TileRef>();
|
||||
frontier.Enqueue(seed);
|
||||
// If we don't have a nearest node don't play any sound.
|
||||
@@ -107,7 +109,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
||||
continue;
|
||||
}
|
||||
|
||||
frontier.Enqueue(grid.GetTileRef(new Vector2i(x, y) + node.GridIndices));
|
||||
frontier.Enqueue(_mapSystem.GetTileRef(gridId, grid, new Vector2i(x, y) + node.GridIndices));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user