Movement systems warning cleanup (#36161)
* Movement systems warning cleanup * Revert unnecessary change * Reverting variable removal and changing entity query * Reverting VV removals * LocalEntity does in fact exist
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
using Content.Shared.Movement.Components;
|
using Content.Shared.Movement.Components;
|
||||||
using Content.Shared.Movement.Systems;
|
using Content.Shared.Movement.Systems;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Timing;
|
|
||||||
|
|
||||||
namespace Content.Client.Movement.Systems;
|
namespace Content.Client.Movement.Systems;
|
||||||
|
|
||||||
@@ -10,8 +9,6 @@ namespace Content.Client.Movement.Systems;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class ClientSpriteMovementSystem : SharedSpriteMovementSystem
|
public sealed class ClientSpriteMovementSystem : SharedSpriteMovementSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
|
||||||
|
|
||||||
private EntityQuery<SpriteComponent> _spriteQuery;
|
private EntityQuery<SpriteComponent> _spriteQuery;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Content.Client.Movement.Components;
|
using Content.Client.Movement.Components;
|
||||||
using Content.Shared.Camera;
|
using Content.Shared.Camera;
|
||||||
using Content.Shared.Inventory;
|
|
||||||
using Content.Shared.Movement.Systems;
|
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.Input;
|
using Robust.Client.Input;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
@@ -16,8 +14,6 @@ public sealed partial class EyeCursorOffsetSystem : EntitySystem
|
|||||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||||
[Dependency] private readonly IPlayerManager _player = default!;
|
[Dependency] private readonly IPlayerManager _player = default!;
|
||||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||||
[Dependency] private readonly SharedContentEyeSystem _contentEye = default!;
|
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
|
||||||
[Dependency] private readonly IClyde _clyde = default!;
|
[Dependency] private readonly IClyde _clyde = default!;
|
||||||
|
|
||||||
// This value is here to make sure the user doesn't have to move their mouse
|
// This value is here to make sure the user doesn't have to move their mouse
|
||||||
@@ -42,7 +38,7 @@ public sealed partial class EyeCursorOffsetSystem : EntitySystem
|
|||||||
|
|
||||||
public Vector2? OffsetAfterMouse(EntityUid uid, EyeCursorOffsetComponent? component)
|
public Vector2? OffsetAfterMouse(EntityUid uid, EyeCursorOffsetComponent? component)
|
||||||
{
|
{
|
||||||
var localPlayer = _player.LocalPlayer?.ControlledEntity;
|
var localPlayer = _player.LocalEntity;
|
||||||
var mousePos = _inputManager.MouseScreenPosition;
|
var mousePos = _inputManager.MouseScreenPosition;
|
||||||
var screenSize = _clyde.MainWindow.Size;
|
var screenSize = _clyde.MainWindow.Size;
|
||||||
var minValue = MathF.Min(screenSize.X / 2, screenSize.Y / 2) * _edgeOffset;
|
var minValue = MathF.Min(screenSize.X / 2, screenSize.Y / 2) * _edgeOffset;
|
||||||
|
|||||||
@@ -28,14 +28,15 @@ public sealed class RotateEyesCommand : IConsoleCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
var query = entManager.EntityQueryEnumerator<InputMoverComponent>();
|
||||||
foreach (var mover in entManager.EntityQuery<InputMoverComponent>(true))
|
while (query.MoveNext(out var uid, out var mover))
|
||||||
{
|
{
|
||||||
if (mover.TargetRelativeRotation.Equals(rotation))
|
if (mover.TargetRelativeRotation.Equals(rotation))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mover.TargetRelativeRotation = rotation;
|
mover.TargetRelativeRotation = rotation;
|
||||||
entManager.Dirty(mover);
|
|
||||||
|
entManager.Dirty(uid, mover);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ public sealed class BoundarySystem : EntitySystem
|
|||||||
// If for whatever reason you want to yeet them to the other side.
|
// If for whatever reason you want to yeet them to the other side.
|
||||||
// offset = new Angle(MathF.PI).RotateVec(offset);
|
// offset = new Angle(MathF.PI).RotateVec(offset);
|
||||||
|
|
||||||
_xform.SetWorldPosition(otherXform, center + offset);
|
_xform.SetWorldPosition((args.OtherEntity, otherXform), center + offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public sealed class PullController : VirtualController
|
|||||||
|
|
||||||
// Cap the distance
|
// Cap the distance
|
||||||
var range = 2f;
|
var range = 2f;
|
||||||
var fromUserCoords = coords.WithEntityId(player, EntityManager);
|
var fromUserCoords = _transformSystem.WithEntityId(coords, player);
|
||||||
var userCoords = new EntityCoordinates(player, Vector2.Zero);
|
var userCoords = new EntityCoordinates(player, Vector2.Zero);
|
||||||
|
|
||||||
if (!_transformSystem.InRange(coords, userCoords, range))
|
if (!_transformSystem.InRange(coords, userCoords, range))
|
||||||
@@ -157,7 +157,7 @@ public sealed class PullController : VirtualController
|
|||||||
}
|
}
|
||||||
|
|
||||||
fromUserCoords = new EntityCoordinates(player, direction.Normalized() * (range - 0.01f));
|
fromUserCoords = new EntityCoordinates(player, direction.Normalized() * (range - 0.01f));
|
||||||
coords = fromUserCoords.WithEntityId(coords.EntityId);
|
coords = _transformSystem.WithEntityId(fromUserCoords, coords.EntityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
var moving = EnsureComp<PullMovingComponent>(pulled!.Value);
|
var moving = EnsureComp<PullMovingComponent>(pulled!.Value);
|
||||||
@@ -248,7 +248,7 @@ public sealed class PullController : VirtualController
|
|||||||
var pullerXform = _xformQuery.Get(puller);
|
var pullerXform = _xformQuery.Get(puller);
|
||||||
var pullerPosition = TransformSystem.GetMapCoordinates(pullerXform);
|
var pullerPosition = TransformSystem.GetMapCoordinates(pullerXform);
|
||||||
|
|
||||||
var movingTo = mover.MovingTo.ToMap(EntityManager, TransformSystem);
|
var movingTo = TransformSystem.ToMapCoordinates(mover.MovingTo);
|
||||||
|
|
||||||
if (movingTo.MapId != pullerPosition.MapId)
|
if (movingTo.MapId != pullerPosition.MapId)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user