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

@@ -295,10 +295,10 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
var gen2Coords = Transform(secondGenComp.Owner).Coordinates;
var delta = (gen2Coords - gen1Coords).Position;
var dirVec = delta.Normalized;
var stopDist = delta.Length;
var dirVec = delta.Normalized();
var stopDist = delta.Length();
var currentOffset = dirVec;
while (currentOffset.Length < stopDist)
while (currentOffset.Length() < stopDist)
{
var currentCoords = gen1Coords.Offset(currentOffset);
var newField = Spawn(firstGenComp.CreatedField, currentCoords);

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using System.Threading;
using Content.Server.Administration.Logs;
using Content.Server.Construction;
@@ -292,7 +293,7 @@ namespace Content.Server.Singularity.EntitySystems
var proj = EnsureComp<ProjectileComponent>(ent);
_projectile.SetShooter(proj, uid);
var targetPos = new EntityCoordinates(uid, (0, -1));
var targetPos = new EntityCoordinates(uid, new Vector2(0, -1));
_gun.Shoot(uid, gunComponent, ent, xform.Coordinates, targetPos, out _);
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Server.Administration.Logs;
using Robust.Shared.Containers;
using Robust.Shared.Timing;

View File

@@ -197,7 +197,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
continue;
var displacement = epicenter - _transform.GetWorldPosition(entity, xformQuery);
var distance2 = displacement.LengthSquared;
var distance2 = displacement.LengthSquared();
if (distance2 < minRange2)
continue;