mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-02-15 04:30:57 +01:00
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user