diff --git a/Content.Shared/Construction/SharedConstructionSystem.cs b/Content.Shared/Construction/SharedConstructionSystem.cs index a2b647ae92..7f75ba63b8 100644 --- a/Content.Shared/Construction/SharedConstructionSystem.cs +++ b/Content.Shared/Construction/SharedConstructionSystem.cs @@ -9,6 +9,7 @@ namespace Content.Shared.Construction public abstract class SharedConstructionSystem : EntitySystem { [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] protected readonly IPrototypeManager PrototypeManager = default!; [Dependency] protected readonly SharedTransformSystem TransformSystem = default!; @@ -20,10 +21,10 @@ namespace Content.Shared.Construction if (!canBuildInImpassable) return null; - if (!_mapManager.TryFindGridAt(coords, out _, out var grid)) + if (!_mapManager.TryFindGridAt(coords, out var gridUid, out var grid)) return null; - var ignored = grid.GetAnchoredEntities(coords).ToHashSet(); + var ignored = _map.GetAnchoredEntities((gridUid, grid), coords).ToHashSet(); return e => ignored.Contains(e); } diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 0695bd3540..230fbda8d3 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -61,6 +61,7 @@ namespace Content.Shared.Interaction [Dependency] private readonly PullingSystem _pullSystem = default!; [Dependency] private readonly RotateToFaceSystem _rotateToFaceSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!; + [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly SharedPhysicsSystem _broadphase = default!; [Dependency] private readonly SharedTransformSystem _transform = 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; } - if (ignoreAnchored && _mapManager.TryFindGridAt(targetCoords, out _, out var grid)) - ignored.UnionWith(grid.GetAnchoredEntities(targetCoords)); + if (ignoreAnchored && _mapManager.TryFindGridAt(targetCoords, out var gridUid, out var grid)) + ignored.UnionWith(_map.GetAnchoredEntities((gridUid, grid), targetCoords)); } Ignored combinedPredicate = e => e == target || (predicate?.Invoke(e) ?? false) || ignored.Contains(e);