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

@@ -48,7 +48,7 @@ namespace Content.Server.Administration.Commands
? _entities.GetComponent<TransformComponent>(player.AttachedEntity.Value).Coordinates
: EntitySystem.Get<GameTicker>().GetObserverSpawnPoint();
var ghost = _entities.SpawnEntity("AdminObserver", coordinates);
_entities.GetComponent<TransformComponent>(ghost).AttachToGridOrMap();
_entities.System<SharedTransformSystem>().AttachToGridOrMap(ghost);
if (canReturn)
{

View File

@@ -4,6 +4,7 @@ using Content.Server.Warps;
using Content.Shared.Administration;
using Content.Shared.Follower;
using Content.Shared.Ghost;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Enums;
@@ -121,9 +122,9 @@ namespace Content.Server.Administration.Commands
return;
}
var xform = _entManager.GetComponent<TransformComponent>(playerEntity);
xform.Coordinates = coords;
xform.AttachToGridOrMap();
var transform = _entManager.System<SharedTransformSystem>();
transform.SetCoordinates(playerEntity, coords);
transform.AttachToGridOrMap(playerEntity);
if (_entManager.TryGetComponent(playerEntity, out PhysicsComponent? physics))
{
_entManager.System<SharedPhysicsSystem>().SetLinearVelocity(playerEntity, Vector2.Zero, body: physics);

View File

@@ -76,6 +76,7 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly VomitSystem _vomitSystem = default!;
[Dependency] private readonly WeldableSystem _weldableSystem = default!;
[Dependency] private readonly SharedContentEyeSystem _eyeSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
// All smite verbs have names so invokeverb works.
private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
@@ -130,8 +131,8 @@ public sealed partial class AdminVerbSystem
Filter.PvsExcept(args.Target), true, PopupType.MediumCaution);
var board = Spawn("ChessBoard", xform.Coordinates);
var session = _tabletopSystem.EnsureSession(Comp<TabletopGameComponent>(board));
xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position);
xform.WorldRotation = Angle.Zero;
_transform.SetCoordinates(args.Target, EntityCoordinates.FromMap(_mapManager, session.Position));
_transform.SetWorldRotation(xform, Angle.Zero);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-chess-dimension-description")