Replace obsolete GetTilesIntersecting methods (#32455)

* Remove usage of obsolete GetTilesIntersecting round 1

* Oop wrong uids

* Remove usage of obsolete GetLocalTilesIntersecting round 2

* Remove usage of obsolete GetLocalTilesIntersecting final round

* weh

* Fix using `SharedMapSystem` in `StencilOverlay`
This commit is contained in:
MilenVolf
2024-12-01 04:56:47 +03:00
committed by GitHub
parent 2d405c9652
commit 5fdf03c216
13 changed files with 42 additions and 19 deletions

View File

@@ -34,6 +34,7 @@ public abstract class SharedAnomalySystem : EntitySystem
[Dependency] protected readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
public override void Initialize()
{
@@ -358,8 +359,11 @@ public abstract class SharedAnomalySystem : EntitySystem
var amount = (int) (MathHelper.Lerp(settings.MinAmount, settings.MaxAmount, severity * stability * powerModifier) + 0.5f);
var localpos = xform.Coordinates.Position;
var tilerefs = grid.GetLocalTilesIntersecting(
new Box2(localpos + new Vector2(-settings.MaxRange, -settings.MaxRange), localpos + new Vector2(settings.MaxRange, settings.MaxRange))).ToList();
var tilerefs = _map.GetLocalTilesIntersecting(
xform.GridUid.Value,
grid,
new Box2(localpos + new Vector2(-settings.MaxRange, -settings.MaxRange), localpos + new Vector2(settings.MaxRange, settings.MaxRange)))
.ToList();
if (tilerefs.Count == 0)
return null;