Purge uses of TransformComponent.AttachToGridOrMap (#34940)
Switches over all extant uses of TransformComponent.AttachToGridOrMap to use SharedTransformSystem.AttachToGridOrMap
This commit is contained in:
@@ -118,8 +118,9 @@ namespace Content.Server.Administration.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
var xform = _entManager.GetComponent<TransformComponent>(playerEntity);
|
var xform = _entManager.GetComponent<TransformComponent>(playerEntity);
|
||||||
|
var xformSystem = _entManager.System<SharedTransformSystem>();
|
||||||
xform.Coordinates = coords;
|
xform.Coordinates = coords;
|
||||||
xform.AttachToGridOrMap();
|
xformSystem.AttachToGridOrMap(playerEntity, xform);
|
||||||
if (_entManager.TryGetComponent(playerEntity, out PhysicsComponent? physics))
|
if (_entManager.TryGetComponent(playerEntity, out PhysicsComponent? physics))
|
||||||
{
|
{
|
||||||
_entManager.System<SharedPhysicsSystem>().SetLinearVelocity(playerEntity, Vector2.Zero, body: physics);
|
_entManager.System<SharedPhysicsSystem>().SetLinearVelocity(playerEntity, Vector2.Zero, body: physics);
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ namespace Content.Server.Construction
|
|||||||
|
|
||||||
// Transform transferring.
|
// Transform transferring.
|
||||||
var newTransform = Transform(newUid);
|
var newTransform = Transform(newUid);
|
||||||
newTransform.AttachToGridOrMap(); // in case in hands or a container
|
TransformSystem.AttachToGridOrMap(newUid, newTransform); // in case in hands or a container
|
||||||
newTransform.LocalRotation = transform.LocalRotation;
|
newTransform.LocalRotation = transform.LocalRotation;
|
||||||
newTransform.Anchored = transform.Anchored;
|
newTransform.Anchored = transform.Anchored;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace Content.Shared.Construction
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
||||||
|
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get predicate for construction obstruction checks.
|
/// Get predicate for construction obstruction checks.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public sealed class ContainerFillSystem : EntitySystem
|
|||||||
if (!_containerSystem.Insert(ent, container, containerXform: xform))
|
if (!_containerSystem.Insert(ent, container, containerXform: xform))
|
||||||
{
|
{
|
||||||
Log.Error($"Entity {ToPrettyString(uid)} with a {nameof(ContainerFillComponent)} failed to insert an entity: {ToPrettyString(ent)}.");
|
Log.Error($"Entity {ToPrettyString(uid)} with a {nameof(ContainerFillComponent)} failed to insert an entity: {ToPrettyString(ent)}.");
|
||||||
Transform(ent).AttachToGridOrMap();
|
_transform.AttachToGridOrMap(ent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user