Cleanup remaining MapGridComponent.GetAnchoredEntities(MapCoordinates) uses (#37729)
Cleanup remaining MapGridComponent.GetAnchoredEntities uses
This commit is contained in:
@@ -9,6 +9,7 @@ namespace Content.Shared.Construction
|
|||||||
public abstract class SharedConstructionSystem : EntitySystem
|
public abstract class SharedConstructionSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||||
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
||||||
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
|
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
|
||||||
|
|
||||||
@@ -20,10 +21,10 @@ namespace Content.Shared.Construction
|
|||||||
if (!canBuildInImpassable)
|
if (!canBuildInImpassable)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!_mapManager.TryFindGridAt(coords, out _, out var grid))
|
if (!_mapManager.TryFindGridAt(coords, out var gridUid, out var grid))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var ignored = grid.GetAnchoredEntities(coords).ToHashSet();
|
var ignored = _map.GetAnchoredEntities((gridUid, grid), coords).ToHashSet();
|
||||||
return e => ignored.Contains(e);
|
return e => ignored.Contains(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ namespace Content.Shared.Interaction
|
|||||||
[Dependency] private readonly PullingSystem _pullSystem = default!;
|
[Dependency] private readonly PullingSystem _pullSystem = default!;
|
||||||
[Dependency] private readonly RotateToFaceSystem _rotateToFaceSystem = default!;
|
[Dependency] private readonly RotateToFaceSystem _rotateToFaceSystem = default!;
|
||||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||||
|
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||||
[Dependency] private readonly SharedPhysicsSystem _broadphase = default!;
|
[Dependency] private readonly SharedPhysicsSystem _broadphase = default!;
|
||||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||||
[Dependency] private readonly SharedVerbSystem _verbSystem = default!;
|
[Dependency] private readonly SharedVerbSystem _verbSystem = default!;
|
||||||
@@ -885,8 +886,8 @@ namespace Content.Shared.Interaction
|
|||||||
ignoreAnchored = angleDelta < wallMount.Arc / 2 || Math.Tau - angleDelta < wallMount.Arc / 2;
|
ignoreAnchored = angleDelta < wallMount.Arc / 2 || Math.Tau - angleDelta < wallMount.Arc / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ignoreAnchored && _mapManager.TryFindGridAt(targetCoords, out _, out var grid))
|
if (ignoreAnchored && _mapManager.TryFindGridAt(targetCoords, out var gridUid, out var grid))
|
||||||
ignored.UnionWith(grid.GetAnchoredEntities(targetCoords));
|
ignored.UnionWith(_map.GetAnchoredEntities((gridUid, grid), targetCoords));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ignored combinedPredicate = e => e == target || (predicate?.Invoke(e) ?? false) || ignored.Contains(e);
|
Ignored combinedPredicate = e => e == target || (predicate?.Invoke(e) ?? false) || ignored.Contains(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user