Update content vectors to numerics (#17759)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Content.Server.Chemistry.Components;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Cooldown;
|
||||
@@ -68,11 +69,11 @@ public sealed class SpraySystem : EntitySystem
|
||||
var clickMapPos = args.ClickLocation.ToMap(EntityManager, _transform);
|
||||
|
||||
var diffPos = clickMapPos.Position - userMapPos.Position;
|
||||
if (diffPos == Vector2.Zero || diffPos == Vector2.NaN)
|
||||
if (diffPos == Vector2.Zero || diffPos == Vector2Helpers.NaN)
|
||||
return;
|
||||
|
||||
var diffNorm = diffPos.Normalized;
|
||||
var diffLength = diffPos.Length;
|
||||
var diffNorm = diffPos.Normalized();
|
||||
var diffLength = diffPos.Length();
|
||||
|
||||
if (diffLength > component.SprayDistance)
|
||||
{
|
||||
@@ -97,9 +98,9 @@ public sealed class SpraySystem : EntitySystem
|
||||
|
||||
// Calculate the destination for the vapor cloud. Limit to the maximum spray distance.
|
||||
var target = userMapPos
|
||||
.Offset((diffNorm + rotation.ToVec()).Normalized * diffLength + quarter);
|
||||
.Offset((diffNorm + rotation.ToVec()).Normalized() * diffLength + quarter);
|
||||
|
||||
var distance = (target.Position - userMapPos.Position).Length;
|
||||
var distance = (target.Position - userMapPos.Position).Length();
|
||||
if (distance > component.SprayDistance)
|
||||
target = userMapPos.Offset(diffNorm * component.SprayDistance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user