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

@@ -21,6 +21,7 @@ using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Linq;
using System.Numerics;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.DragDrop;
@@ -405,7 +406,9 @@ public sealed class DragDropSystem : SharedDragDropSystem
// find possible targets on screen even if not reachable
// TODO: Duplicated in SpriteSystem and TargetOutlineSystem. Should probably be cached somewhere for a frame?
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition);
var bounds = new Box2(mousePos.Position - 1.5f, mousePos.Position + 1.5f);
var expansion = new Vector2(1.5f, 1.5f);
var bounds = new Box2(mousePos.Position - expansion, mousePos.Position + expansion);
var pvsEntities = _lookup.GetEntitiesIntersecting(mousePos.MapId, bounds);
var spriteQuery = GetEntityQuery<SpriteComponent>();
@@ -510,7 +513,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
case DragState.MouseDown:
{
var screenPos = _inputManager.MouseScreenPosition;
if ((_mouseDownScreenPos!.Value.Position - screenPos.Position).Length > _deadzone)
if ((_mouseDownScreenPos!.Value.Position - screenPos.Position).Length() > _deadzone)
{
StartDrag();
}