Inline Transform
This commit is contained in:
@@ -51,9 +51,9 @@ namespace Content.Server.Hands.Components
|
||||
|
||||
protected override void HandlePickupAnimation(IEntity entity)
|
||||
{
|
||||
var initialPosition = EntityCoordinates.FromMap(Owner.Transform.Parent?.Owner ?? Owner, entity.Transform.MapPosition);
|
||||
var initialPosition = EntityCoordinates.FromMap(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Parent?.Owner ?? Owner, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).MapPosition);
|
||||
|
||||
var finalPosition = Owner.Transform.LocalPosition;
|
||||
var finalPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalPosition;
|
||||
|
||||
if (finalPosition.EqualsApprox(initialPosition.Position))
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Hands.Systems
|
||||
if (!hand.IsEmpty)
|
||||
continue;
|
||||
|
||||
var pos = hands.Owner.Transform.Coordinates;
|
||||
var pos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(hands.Owner.Uid).Coordinates;
|
||||
var virtualItem = EntityManager.SpawnEntity("HandVirtualItem", pos);
|
||||
var virtualItemComp = IoCManager.Resolve<IEntityManager>().GetComponent<HandVirtualItemComponent>(virtualItem.Uid);
|
||||
virtualItemComp.BlockingEntity = blockingEnt;
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Content.Server.Hands.Systems
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(throwEnt.Uid, out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
|
||||
{
|
||||
var splitStack = _stackSystem.Split(throwEnt.Uid, 1, playerEnt.Transform.Coordinates, stack);
|
||||
var splitStack = _stackSystem.Split(throwEnt.Uid, 1, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(playerEnt.Uid).Coordinates, stack);
|
||||
|
||||
if (splitStack == null)
|
||||
return false;
|
||||
@@ -240,7 +240,7 @@ namespace Content.Server.Hands.Systems
|
||||
else if (!hands.Drop(throwEnt))
|
||||
return false;
|
||||
|
||||
var direction = coords.ToMapPos(EntityManager) - playerEnt.Transform.WorldPosition;
|
||||
var direction = coords.ToMapPos(EntityManager) - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(playerEnt.Uid).WorldPosition;
|
||||
if (direction == Vector2.Zero)
|
||||
return true;
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Content.Server.Hands.Systems
|
||||
if (storageComponent.Remove(lastStoredEntity))
|
||||
{
|
||||
if (!hands.TryPickupEntityToActiveHand(lastStoredEntity))
|
||||
lastStoredEntity.Transform.Coordinates = plyEnt.Transform.Coordinates;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(lastStoredEntity.Uid).Coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(plyEnt.Uid).Coordinates;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user