Remove most usages of obsolete TransformComponent methods (#19571)
This commit is contained in:
@@ -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 _transform = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -26,16 +27,16 @@ public sealed class ContainmentFieldSystem : EntitySystem
|
||||
{
|
||||
var otherBody = args.OtherEntity;
|
||||
|
||||
if (TryComp<SpaceGarbageComponent>(otherBody, out var garbage))
|
||||
if (HasComp<SpaceGarbageComponent>(otherBody))
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("comp-field-vaporized", ("entity", otherBody)), component.Owner, PopupType.LargeCaution);
|
||||
QueueDel(garbage.Owner);
|
||||
_popupSystem.PopupEntity(Loc.GetString("comp-field-vaporized", ("entity", otherBody)), uid, PopupType.LargeCaution);
|
||||
QueueDel(otherBody);
|
||||
}
|
||||
|
||||
if (TryComp<PhysicsComponent>(otherBody, out var physics) && physics.Mass <= component.MaxMass && physics.Hard)
|
||||
{
|
||||
var fieldDir = Transform(component.Owner).WorldPosition;
|
||||
var playerDir = Transform(otherBody).WorldPosition;
|
||||
var fieldDir = _transform.GetWorldPosition(uid);
|
||||
var playerDir = _transform.GetWorldPosition(otherBody);
|
||||
|
||||
_throwing.TryThrow(otherBody, playerDir-fieldDir, strength: component.ThrowForce);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user