Files
wwdpublic/Content.Shared/Movement/Events/MoveInputEvent.cs
Plykiya 90d89b0610 Update MoverController.cs to not use Component.Owner (#29965)
* Update MoverController.cs

* Update a bunch of movement code to use Entity<T>

* Last errors

* wow, there were more errors

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
(cherry picked from commit 5bb56c08d7dd6a64feefa503da3d004f8fb0966c)
2025-01-15 18:22:17 +03:00

23 lines
656 B
C#

using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
namespace Content.Shared.Movement.Events;
/// <summary>
/// Raised on an entity whenever it has a movement input change.
/// </summary>
[ByRefEvent]
public readonly struct MoveInputEvent
{
public readonly Entity<InputMoverComponent> Entity;
public readonly MoveButtons OldMovement;
public bool HasDirectionalMovement => (Entity.Comp.HeldMoveButtons & MoveButtons.AnyDirection) != MoveButtons.None;
public MoveInputEvent(Entity<InputMoverComponent> entity, MoveButtons oldMovement)
{
Entity = entity;
OldMovement = oldMovement;
}
}