Holding the walk button no longer activates sprite movement state (#24455)

* Dancing is forbidden

* Suggested changes
This commit is contained in:
Tayrtahn
2024-01-23 20:26:45 -05:00
committed by GitHub
parent 54290e9591
commit c1fd42202f
2 changed files with 3 additions and 2 deletions

View File

@@ -27,8 +27,8 @@ public sealed class SpriteMovementSystem : EntitySystem
if (!_timing.IsFirstTimePredicted) if (!_timing.IsFirstTimePredicted)
return; return;
var oldMoving = SharedMoverController.GetNormalizedMovement(args.OldMovement) != MoveButtons.None; var oldMoving = (SharedMoverController.GetNormalizedMovement(args.OldMovement) & MoveButtons.AnyDirection) != MoveButtons.None;
var moving = SharedMoverController.GetNormalizedMovement(args.Component.HeldMoveButtons) != MoveButtons.None; var moving = (SharedMoverController.GetNormalizedMovement(args.Component.HeldMoveButtons) & MoveButtons.AnyDirection) != MoveButtons.None;
if (oldMoving == moving || !_spriteQuery.TryGetComponent(uid, out var sprite)) if (oldMoving == moving || !_spriteQuery.TryGetComponent(uid, out var sprite))
return; return;

View File

@@ -626,6 +626,7 @@ namespace Content.Shared.Movement.Systems
Left = 4, Left = 4,
Right = 8, Right = 8,
Walk = 16, Walk = 16,
AnyDirection = Up | Down | Left | Right,
} }
[Flags] [Flags]