Skip to content

Commit

Permalink
Let the function do the transform
Browse files Browse the repository at this point in the history
  • Loading branch information
plykiya committed Jul 14, 2024
1 parent ebdd27b commit 0dd3dd1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Content.Client/Outline/TargetOutlineSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ private void HighlightTargets()
valid = _interactionSystem.InRangeUnobstructed(player, entity, Range);
else if (Range >= 0)
{
var origin = _transformSystem.GetWorldPosition(Transform(player));
var target = _transformSystem.GetWorldPosition(Transform(entity));
var origin = _transformSystem.GetWorldPosition(player);
var target = _transformSystem.GetWorldPosition(entity);
valid = (origin - target).LengthSquared() <= Range;
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ private void CameraShake(float range, MapCoordinates epicenter, float totalInten
if (player.AttachedEntity is not EntityUid uid)
continue;

var playerPos = _transformSystem.GetWorldPosition(Transform(player.AttachedEntity!.Value));
var playerPos = _transformSystem.GetWorldPosition(player.AttachedEntity!.Value);
var delta = epicenter.Position - playerPos;

if (delta.EqualsApprox(Vector2.Zero))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ private void HandleFieldCollide(EntityUid uid, ContainmentFieldComponent compone

if (TryComp<PhysicsComponent>(otherBody, out var physics) && physics.Mass <= component.MaxMass && physics.Hard)
{
var fieldDir = _transformSystem.GetWorldPosition(Transform(uid));
var playerDir = _transformSystem.GetWorldPosition(Transform(otherBody));
var fieldDir = _transformSystem.GetWorldPosition(uid);
var playerDir = _transformSystem.GetWorldPosition(otherBody);

_throwing.TryThrow(otherBody, playerDir-fieldDir, baseThrowSpeed: component.ThrowForce);
}
Expand Down

0 comments on commit 0dd3dd1

Please sign in to comment.