mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
Fix wrong system usage (#33679)
Fix wrong system using (cherry picked from commit d4067bcaab3f0b258ec055aeeb491514a1b76f4d)
This commit is contained in:
@@ -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