]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup remaining `MapGridComponent.GetAnchoredEntities(MapCoordinates)` uses (#37729)
authorTayrtahn <tayrtahn@gmail.com>
Fri, 23 May 2025 01:42:47 +0000 (21:42 -0400)
committerGitHub <noreply@github.com>
Fri, 23 May 2025 01:42:47 +0000 (21:42 -0400)
Cleanup remaining MapGridComponent.GetAnchoredEntities uses

Content.Shared/Construction/SharedConstructionSystem.cs
Content.Shared/Interaction/SharedInteractionSystem.cs

index a2b647ae927861ae44d2e35d6b39d2c6e96cb937..7f75ba63b8684647c108ebf2c458323147d61828 100644 (file)
@@ -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);
         }
 
index 0695bd3540d59f83562c05d50ceb18d6fd3d26ed..230fbda8d3a47981bd6e0877829314dca0c45927 100644 (file)
@@ -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);