Code cleanup: Purge calls to obsolete EntityCoordinates methods (#26292)

* Purge calls to obsolete EntityCoordinates methods

* Pizza defruited; rerun those tests!
This commit is contained in:
Tayrtahn
2024-03-20 21:59:56 -04:00
committed by GitHub
parent b34777177c
commit f4cb02fb0c
34 changed files with 70 additions and 56 deletions

View File

@@ -18,13 +18,13 @@ namespace Content.Server.Singularity.EntitySystems;
/// </summary>
public sealed class GravityWellSystem : SharedGravityWellSystem
{
#region Dependencies
#region Dependencies
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IViewVariablesManager _vvManager = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
#endregion Dependencies
#endregion Dependencies
/// <summary>
/// The minimum range at which gravpulses will act.
@@ -155,7 +155,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
/// <param name="minRange">The minimum distance at which entities can be affected by the gravity pulse.</param>
/// <param name="baseMatrixDeltaV">The base velocity added to any entities within affected by the gravity pulse scaled by the displacement of those entities from the epicenter.</param>
public void GravPulse(EntityCoordinates entityPos, float maxRange, float minRange, in Matrix3 baseMatrixDeltaV)
=> GravPulse(entityPos.ToMap(EntityManager), maxRange, minRange, in baseMatrixDeltaV);
=> GravPulse(entityPos.ToMap(EntityManager, _transform), maxRange, minRange, in baseMatrixDeltaV);
/// <summary>
/// Greates a gravitational pulse, shoving around all entities within some distance of an epicenter.
@@ -166,7 +166,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
/// <param name="baseRadialDeltaV">The base radial velocity that will be added to entities within range towards the center of the gravitational pulse.</param>
/// <param name="baseTangentialDeltaV">The base tangential velocity that will be added to entities within countrclockwise around the center of the gravitational pulse.</param>
public void GravPulse(EntityCoordinates entityPos, float maxRange, float minRange, float baseRadialDeltaV = 0.0f, float baseTangentialDeltaV = 0.0f)
=> GravPulse(entityPos.ToMap(EntityManager), maxRange, minRange, baseRadialDeltaV, baseTangentialDeltaV);
=> GravPulse(entityPos.ToMap(EntityManager, _transform), maxRange, minRange, baseRadialDeltaV, baseTangentialDeltaV);
/// <summary>
/// Causes a gravitational pulse, shoving around all entities within some distance of an epicenter.

View File

@@ -2,12 +2,7 @@ using Content.Server.Physics.Components;
using Content.Server.Power.EntitySystems;
using Content.Server.Singularity.Components;
using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Timing;
using System.Numerics;
@@ -18,8 +13,8 @@ namespace Content.Server.Singularity.EntitySystems;
/// </summary>
public sealed class SingularityAttractorSystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
/// <summary>
/// The minimum range at which the attraction will act.
@@ -69,7 +64,7 @@ public sealed class SingularityAttractorSystem : EntitySystem
attractor.LastPulseTime = _timing.CurTime;
var mapPos = xform.Coordinates.ToMap(EntityManager);
var mapPos = xform.Coordinates.ToMap(EntityManager, _transform);
if (mapPos == MapCoordinates.Nullspace)
return;
@@ -77,7 +72,7 @@ public sealed class SingularityAttractorSystem : EntitySystem
var query = EntityQuery<SingularityComponent, RandomWalkComponent, TransformComponent>();
foreach (var (singulo, walk, singuloXform) in query)
{
var singuloMapPos = singuloXform.Coordinates.ToMap(EntityManager);
var singuloMapPos = singuloXform.Coordinates.ToMap(EntityManager, _transform);
if (singuloMapPos.MapId != mapPos.MapId)
continue;