Replace xform.WorldPosition with xformSystem method for Setting/Getting (#30029)

* GET WORLD POSITON, ROTATION

* Missing parentheses

* ui system depndency

* the issue

* Unused

* Let the function do the transform

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
Plykiya
2024-08-06 04:02:01 -07:00
committed by GitHub
parent 7b3ff00129
commit a87efd7d01
35 changed files with 89 additions and 59 deletions

View File

@@ -1,4 +1,4 @@
using Content.Server.Popups;
using Content.Server.Popups;
using Content.Server.Shuttles.Components;
using Content.Server.Singularity.Events;
using Content.Shared.Popups;
@@ -13,6 +13,7 @@ public sealed class ContainmentFieldSystem : EntitySystem
{
[Dependency] private readonly ThrowingSystem _throwing = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
public override void Initialize()
{
@@ -34,8 +35,8 @@ public sealed class ContainmentFieldSystem : EntitySystem
if (TryComp<PhysicsComponent>(otherBody, out var physics) && physics.Mass <= component.MaxMass && physics.Hard)
{
var fieldDir = Transform(uid).WorldPosition;
var playerDir = Transform(otherBody).WorldPosition;
var fieldDir = _transformSystem.GetWorldPosition(uid);
var playerDir = _transformSystem.GetWorldPosition(otherBody);
_throwing.TryThrow(otherBody, playerDir-fieldDir, baseThrowSpeed: component.ThrowForce);
}