Inline Transform
This commit is contained in:
@@ -41,11 +41,11 @@ namespace Content.Server.Physics.Controllers
|
||||
}
|
||||
|
||||
var direction = system.GetAngle(comp).ToVec();
|
||||
var ownerPos = comp.Owner.Transform.WorldPosition;
|
||||
var ownerPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner.Uid).WorldPosition;
|
||||
|
||||
foreach (var (entity, physics) in EntitySystem.Get<ConveyorSystem>().GetEntitiesToMove(comp))
|
||||
{
|
||||
var itemRelativeToConveyor = entity.Transform.WorldPosition - ownerPos;
|
||||
var itemRelativeToConveyor = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).WorldPosition - ownerPos;
|
||||
physics.LinearVelocity += Convey(direction, comp.Speed, frameTime, itemRelativeToConveyor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace Content.Server.Physics.Controllers
|
||||
{
|
||||
if (!mover.Owner.HasTag("FootstepSound")) return;
|
||||
|
||||
var transform = mover.Owner.Transform;
|
||||
var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(mover.Owner.Uid);
|
||||
var coordinates = transform.Coordinates;
|
||||
var gridId = coordinates.GetGridId(EntityManager);
|
||||
var distanceNeeded = mover.Sprinting ? StepSoundMoveDistanceRunning : StepSoundMoveDistanceWalking;
|
||||
@@ -352,7 +352,7 @@ namespace Content.Server.Physics.Controllers
|
||||
SoundSystem.Play(
|
||||
Filter.Pvs(coordinates),
|
||||
soundToPlay,
|
||||
mover.Transform.Coordinates,
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(mover.Uid).Coordinates,
|
||||
sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Content.Server.Physics.Controllers
|
||||
|
||||
// Now that's over with...
|
||||
|
||||
var pullerPosition = puller.Transform.MapPosition;
|
||||
var pullerPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(puller.Uid).MapPosition;
|
||||
var movingTo = pullable.MovingTo.Value.ToMap(IoCManager.Resolve<IEntityManager>());
|
||||
if (movingTo.MapId != pullerPosition.MapId)
|
||||
{
|
||||
@@ -84,14 +84,14 @@ namespace Content.Server.Physics.Controllers
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<PhysicsComponent?>(pullable.Owner.Uid, out var physics) ||
|
||||
physics.BodyType == BodyType.Static ||
|
||||
movingTo.MapId != pullable.Owner.Transform.MapID)
|
||||
movingTo.MapId != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pullable.Owner.Uid).MapID)
|
||||
{
|
||||
_pullableSystem.StopMoveTo(pullable);
|
||||
continue;
|
||||
}
|
||||
|
||||
var movingPosition = movingTo.Position;
|
||||
var ownerPosition = pullable.Owner.Transform.MapPosition.Position;
|
||||
var ownerPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pullable.Owner.Uid).MapPosition.Position;
|
||||
|
||||
var diff = movingPosition - ownerPosition;
|
||||
var diffLength = diff.Length;
|
||||
|
||||
Reference in New Issue
Block a user