Revert "Remove most usages of obsolete TransformComponent methods (#1… (#19714)
This commit is contained in:
@@ -54,7 +54,6 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
||||
[Dependency] private readonly ShuttleSystem _shuttle = default!;
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
@@ -416,6 +415,6 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
||||
if (!Resolve(shuttle, ref grid, ref shuttleXform))
|
||||
return false;
|
||||
|
||||
return _transform.GetWorldMatrix(shuttleXform).TransformBox(grid.LocalAABB).Contains(_transform.GetWorldPosition(xform));
|
||||
return shuttleXform.WorldMatrix.TransformBox(grid.LocalAABB).Contains(xform.WorldPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,8 +250,8 @@ public sealed partial class ShuttleSystem
|
||||
var fromRotation = _transform.GetWorldRotation(xform);
|
||||
|
||||
var width = Comp<MapGridComponent>(uid).LocalAABB.Width;
|
||||
_transform.SetCoordinates(uid, xform, new EntityCoordinates(_mapManager.GetMapEntityId(_hyperSpaceMap!.Value), new Vector2(_index + width / 2f, 0f)));
|
||||
_transform.SetLocalRotation(xform, Angle.Zero);
|
||||
xform.Coordinates = new EntityCoordinates(_mapManager.GetMapEntityId(_hyperSpaceMap!.Value), new Vector2(_index + width / 2f, 0f));
|
||||
xform.LocalRotation = Angle.Zero;
|
||||
_index += width + Buffer;
|
||||
comp.Accumulator += comp.TravelTime - DefaultArrivalTime;
|
||||
|
||||
@@ -336,7 +336,7 @@ public sealed partial class ShuttleSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
_transform.SetCoordinates(uid, xform, comp.TargetCoordinates);
|
||||
xform.Coordinates = comp.TargetCoordinates;
|
||||
mapId = comp.TargetCoordinates.GetMapId(EntityManager);
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
if (config != null)
|
||||
{
|
||||
FTLDock(config, shuttleUid, shuttleXform);
|
||||
FTLDock(config, shuttleXform);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -517,13 +517,10 @@ public sealed partial class ShuttleSystem
|
||||
/// <summary>
|
||||
/// Forces an FTL dock.
|
||||
/// </summary>
|
||||
public void FTLDock(DockingConfig config, EntityUid uid, TransformComponent? shuttleXform = null)
|
||||
public void FTLDock(DockingConfig config, TransformComponent shuttleXform)
|
||||
{
|
||||
if (!Resolve(uid, ref shuttleXform))
|
||||
return;
|
||||
|
||||
// Set position
|
||||
_transform.SetCoordinates(uid, shuttleXform, config.Coordinates);
|
||||
shuttleXform.Coordinates = config.Coordinates;
|
||||
_transform.SetWorldRotation(shuttleXform, config.Angle);
|
||||
|
||||
// Connect everything
|
||||
@@ -632,7 +629,7 @@ public sealed partial class ShuttleSystem
|
||||
spawnPos = _transform.GetWorldPosition(targetXform, xformQuery);
|
||||
}
|
||||
|
||||
_transform.SetCoordinates(shuttleUid, xform, new EntityCoordinates(targetXform.MapUid.Value, spawnPos));
|
||||
xform.Coordinates = new EntityCoordinates(targetXform.MapUid.Value, spawnPos);
|
||||
|
||||
if (!HasComp<MapComponent>(targetXform.GridUid))
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
if (config != null)
|
||||
{
|
||||
FTLDock(config, ent[0], shuttleXform);
|
||||
FTLDock(config, shuttleXform);
|
||||
|
||||
if (TryComp<StationMemberComponent>(xform.GridUid, out var stationMember))
|
||||
{
|
||||
|
||||
@@ -38,8 +38,8 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
var otherXform = Transform(args.OtherEntity);
|
||||
|
||||
var ourPoint = _transform.GetInvWorldMatrix(ourXform).Transform(args.WorldPoint);
|
||||
var otherPoint = _transform.GetInvWorldMatrix(otherXform).Transform(args.WorldPoint);
|
||||
var ourPoint = ourXform.InvWorldMatrix.Transform(args.WorldPoint);
|
||||
var otherPoint = otherXform.InvWorldMatrix.Transform(args.WorldPoint);
|
||||
|
||||
var ourVelocity = _physics.GetLinearVelocity(uid, ourPoint, ourBody, ourXform);
|
||||
var otherVelocity = _physics.GetLinearVelocity(args.OtherEntity, otherPoint, otherBody, otherXform);
|
||||
|
||||
Reference in New Issue
Block a user