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.Systems;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Movement.Systems;
|
||||
|
||||
@@ -10,8 +9,6 @@ namespace Content.Client.Movement.Systems;
|
||||
/// </summary>
|
||||
public sealed class ClientSpriteMovementSystem : SharedSpriteMovementSystem
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
private EntityQuery<SpriteComponent> _spriteQuery;
|
||||
|
||||
public override void Initialize()
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.Movement.Components;
|
||||
using Content.Shared.Camera;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Shared.Map;
|
||||
@@ -16,8 +14,6 @@ public sealed partial class EyeCursorOffsetSystem : EntitySystem
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _player = 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!;
|
||||
|
||||
// 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)
|
||||
{
|
||||
var localPlayer = _player.LocalPlayer?.ControlledEntity;
|
||||
var localPlayer = _player.LocalEntity;
|
||||
var mousePos = _inputManager.MouseScreenPosition;
|
||||
var screenSize = _clyde.MainWindow.Size;
|
||||
var minValue = MathF.Min(screenSize.X / 2, screenSize.Y / 2) * _edgeOffset;
|
||||
|
||||
@@ -28,14 +28,15 @@ public sealed class RotateEyesCommand : IConsoleCommand
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
foreach (var mover in entManager.EntityQuery<InputMoverComponent>(true))
|
||||
var query = entManager.EntityQueryEnumerator<InputMoverComponent>();
|
||||
while (query.MoveNext(out var uid, out var mover))
|
||||
{
|
||||
if (mover.TargetRelativeRotation.Equals(rotation))
|
||||
continue;
|
||||
|
||||
mover.TargetRelativeRotation = rotation;
|
||||
entManager.Dirty(mover);
|
||||
|
||||
entManager.Dirty(uid, mover);
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ public sealed class BoundarySystem : EntitySystem
|
||||
// If for whatever reason you want to yeet them to the other side.
|
||||
// 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
|
||||
var range = 2f;
|
||||
var fromUserCoords = coords.WithEntityId(player, EntityManager);
|
||||
var fromUserCoords = _transformSystem.WithEntityId(coords, player);
|
||||
var userCoords = new EntityCoordinates(player, Vector2.Zero);
|
||||
|
||||
if (!_transformSystem.InRange(coords, userCoords, range))
|
||||
@@ -157,7 +157,7 @@ public sealed class PullController : VirtualController
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -248,7 +248,7 @@ public sealed class PullController : VirtualController
|
||||
var pullerXform = _xformQuery.Get(puller);
|
||||
var pullerPosition = TransformSystem.GetMapCoordinates(pullerXform);
|
||||
|
||||
var movingTo = mover.MovingTo.ToMap(EntityManager, TransformSystem);
|
||||
var movingTo = TransformSystem.ToMapCoordinates(mover.MovingTo);
|
||||
|
||||
if (movingTo.MapId != pullerPosition.MapId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user