Update content vectors to numerics (#17759)

This commit is contained in:
metalgearsloth
2023-07-08 14:08:32 +10:00
committed by GitHub
parent 15772478c9
commit 68480af109
383 changed files with 978 additions and 575 deletions

View File

@@ -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)