Remove most usages of obsolete TransformComponent methods (#19571)

This commit is contained in:
Visne
2023-08-30 04:05:19 +02:00
committed by GitHub
parent 3ba60835ec
commit 1416942bea
91 changed files with 312 additions and 221 deletions

View File

@@ -18,6 +18,7 @@ namespace Content.Server.Atmos.EntitySystems
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IConfigurationManager _configManager = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
/// <summary>
/// Players allowed to see the atmos debug overlay.
@@ -134,7 +135,7 @@ namespace Content.Server.Atmos.EntitySystems
var mapIsSpace = _atmosphereSystem.IsTileSpace(null, mapUid, Vector2i.Zero);
var worldBounds = Box2.CenteredAround(transform.WorldPosition,
var worldBounds = Box2.CenteredAround(_transform.GetWorldPosition(transform),
new Vector2(LocalViewRange, LocalViewRange));
foreach (var grid in _mapManager.FindGridsIntersecting(transform.MapID, worldBounds))

View File

@@ -15,6 +15,8 @@ namespace Content.Server.Atmos.EntitySystems
{
public sealed partial class AtmosphereSystem
{
[Dependency] private readonly SharedTransformSystem _transform = default!;
private const int SpaceWindSoundCooldownCycles = 75;
private int _spaceWindSoundCooldown = 0;
@@ -118,7 +120,7 @@ namespace Content.Server.Atmos.EntitySystems
return;
// Used by ExperiencePressureDifference to correct push/throw directions from tile-relative to physics world.
var gridWorldRotation = xforms.GetComponent(gridAtmosphere.Owner).WorldRotation;
var gridWorldRotation = _transform.GetWorldRotation(gridAtmosphere.Owner);
// If we're using monstermos, smooth out the yeet direction to follow the flow
if (MonstermosEqualization)
@@ -234,7 +236,7 @@ namespace Content.Server.Atmos.EntitySystems
// TODO: Technically these directions won't be correct but uhh I'm just here for optimisations buddy not to fix my old bugs.
if (throwTarget != EntityCoordinates.Invalid)
{
var pos = ((throwTarget.ToMap(EntityManager).Position - xform.WorldPosition).Normalized() + dirVec).Normalized();
var pos = ((throwTarget.ToMap(EntityManager).Position - _transform.GetWorldPosition(xform)).Normalized() + dirVec).Normalized();
_physics.ApplyLinearImpulse(uid, pos * moveForce, body: physics);
}
else