Inline Transform
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Content.Shared.Interaction
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
public bool TryFaceCoordinates(IEntity user, Vector2 coordinates)
|
||||
{
|
||||
var diff = coordinates - user.Transform.MapPosition.Position;
|
||||
var diff = coordinates - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).MapPosition.Position;
|
||||
if (diff.LengthSquared <= 0.01f)
|
||||
return true;
|
||||
var diffAngle = Angle.FromWorldVec(diff);
|
||||
@@ -47,7 +47,7 @@ namespace Content.Shared.Interaction
|
||||
{
|
||||
if (_actionBlockerSystem.CanChangeDirection(user.Uid))
|
||||
{
|
||||
user.Transform.WorldRotation = diffAngle;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).WorldRotation = diffAngle;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -64,7 +64,7 @@ namespace Content.Shared.Interaction
|
||||
// (Since the user being buckled to it holds it down with their weight.)
|
||||
// This is logically equivalent to RotateWhileAnchored.
|
||||
// Barstools and office chairs have independent wheels, while regular chairs don't.
|
||||
rotatable.Owner.Transform.WorldRotation = diffAngle;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(rotatable.Owner.Uid).WorldRotation = diffAngle;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user