Update content vectors to numerics (#17759)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Pinpointer;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Shared.IdentityManagement;
|
||||
@@ -117,7 +118,7 @@ public sealed class PinpointerSystem : SharedPinpointerSystem
|
||||
if (!xformQuery.TryGetComponent(comp.Owner, out var compXform) || compXform.MapID != mapId)
|
||||
continue;
|
||||
|
||||
var dist = (_transform.GetWorldPosition(compXform, xformQuery) - worldPos).LengthSquared;
|
||||
var dist = (_transform.GetWorldPosition(compXform, xformQuery) - worldPos).LengthSquared();
|
||||
l.TryAdd(dist, comp.Owner);
|
||||
}
|
||||
|
||||
@@ -198,7 +199,7 @@ public sealed class PinpointerSystem : SharedPinpointerSystem
|
||||
|
||||
private Distance CalculateDistance(Vector2 vec, PinpointerComponent pinpointer)
|
||||
{
|
||||
var dist = vec.Length;
|
||||
var dist = vec.Length();
|
||||
if (dist <= pinpointer.ReachedDistance)
|
||||
return Distance.Reached;
|
||||
else if (dist <= pinpointer.CloseDistance)
|
||||
|
||||
Reference in New Issue
Block a user