]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix wrong system usage (#33679)
authorMilenVolf <63782763+MilenVolf@users.noreply.github.com>
Sun, 1 Dec 2024 19:34:18 +0000 (22:34 +0300)
committerGitHub <noreply@github.com>
Sun, 1 Dec 2024 19:34:18 +0000 (11:34 -0800)
Fix wrong system using

Content.Shared/Random/Rules/NearbyTilesPercent.cs

index 8d6485dc7681f67cb362862041d4f4f64c78132a..beadfea05becc26c0dea79beb4aa2f6b91130106 100644 (file)
@@ -23,8 +23,6 @@ public sealed partial class NearbyTilesPercentRule : RulesRule
     [DataField]
     public float Range = 10f;
 
-    private readonly SharedMapSystem _map;
-
     public override bool Check(EntityManager entManager, EntityUid uid)
     {
         if (!entManager.TryGetComponent(uid, out TransformComponent? xform) ||
@@ -34,13 +32,14 @@ public sealed partial class NearbyTilesPercentRule : RulesRule
         }
 
         var transform = entManager.System<SharedTransformSystem>();
+        var mapSys = entManager.System<SharedMapSystem>();
         var tileDef = IoCManager.Resolve<ITileDefinitionManager>();
 
         var physicsQuery = entManager.GetEntityQuery<PhysicsComponent>();
         var tileCount = 0;
         var matchingTileCount = 0;
 
-        foreach (var tile in _map.GetTilesIntersecting(xform.GridUid.Value, grid, new Circle(transform.GetWorldPosition(xform),
+        foreach (var tile in mapSys.GetTilesIntersecting(xform.GridUid.Value, grid, new Circle(transform.GetWorldPosition(xform),
                      Range)))
         {
             // Only consider collidable anchored (for reasons some subfloor stuff has physics but non-collidable)