Resolve 'TransformComponent.MapPosition' is obsolete in content (#27939)

* Resolve `'TransformComponent.MapPosition' is obsolete: 'Use TransformSystem.GetMapCoordinates'` in content

* build?
This commit is contained in:
Kara
2024-05-12 07:31:54 -07:00
committed by GitHub
parent 8938e1d8b2
commit 855234aa30
59 changed files with 152 additions and 84 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Anomaly.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using System.Linq;
using Robust.Server.GameObjects;
namespace Content.Server.Anomaly.Effects;
/// <summary>
@@ -16,6 +17,7 @@ public sealed class InjectionAnomalySystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly TransformSystem _transform = default!;
private EntityQuery<InjectableSolutionComponent> _injectableQuery;
@@ -45,7 +47,7 @@ public sealed class InjectionAnomalySystem : EntitySystem
//We get all the entity in the radius into which the reagent will be injected.
var xformQuery = GetEntityQuery<TransformComponent>();
var xform = xformQuery.GetComponent(entity);
var allEnts = _lookup.GetEntitiesInRange<InjectableSolutionComponent>(xform.MapPosition, injectRadius)
var allEnts = _lookup.GetEntitiesInRange<InjectableSolutionComponent>(_transform.GetMapCoordinates(entity, xform: xform), injectRadius)
.Select(x => x.Owner).ToList();
//for each matching entity found