Fix wrong system usage (#33679)

Fix wrong system using
This commit is contained in:
MilenVolf
2024-12-01 22:34:18 +03:00
committed by GitHub
parent 237324e268
commit d4067bcaab

View 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)