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

@@ -15,7 +15,7 @@ namespace Content.Server.Construction.Completions
var transform = entityManager.GetComponent<TransformComponent>(uid);
if (!transform.Anchored)
transform.Coordinates = transform.Coordinates.SnapToGrid(entityManager);
entityManager.System<SharedTransformSystem>().SetCoordinates(uid, transform, transform.Coordinates.SnapToGrid(entityManager));
if (SouthRotation)
{

View File

@@ -341,7 +341,7 @@ namespace Content.Server.Construction
// Transform transferring.
var newTransform = Transform(newUid);
newTransform.AttachToGridOrMap(); // in case in hands or a container
_transform.AttachToGridOrMap(newUid, newTransform); // in case in hands or a container
newTransform.LocalRotation = transform.LocalRotation;
newTransform.Anchored = transform.Anchored;

View File

@@ -31,6 +31,7 @@ namespace Content.Server.Construction
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
[Dependency] private readonly StorageSystem _storageSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
// --- WARNING! LEGACY CODE AHEAD! ---
// This entire file contains the legacy code for initial construction.
@@ -515,7 +516,7 @@ namespace Content.Server.Construction
var xform = Transform(structure);
var wasAnchored = xform.Anchored;
xform.Anchored = false;
xform.Coordinates = ev.Location;
_transform.SetCoordinates(structure, xform, ev.Location);
xform.LocalRotation = constructionPrototype.CanRotate ? ev.Angle : Angle.Zero;
xform.Anchored = wasAnchored;