diff --git a/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs b/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs index 4b8e1e3eb8..4c9b0b5944 100644 --- a/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs +++ b/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs @@ -83,7 +83,7 @@ namespace Content.IntegrationTests.Tests.Buckle Assert.Null(buckle.BuckledTo); Assert.False(buckle.Buckled); Assert.True(actionBlocker.CanMove(human.Uid)); - Assert.True(actionBlocker.CanChangeDirection(human)); + Assert.True(actionBlocker.CanChangeDirection(human.Uid)); Assert.True(standingState.Down(human.Uid)); Assert.True(standingState.Stand(human.Uid)); @@ -101,7 +101,7 @@ namespace Content.IntegrationTests.Tests.Buckle var player = IoCManager.Resolve().GetAllPlayers().Single(); Assert.True(((BuckleComponentState) buckle.GetComponentState(player)).Buckled); Assert.False(actionBlocker.CanMove(human.Uid)); - Assert.False(actionBlocker.CanChangeDirection(human)); + Assert.False(actionBlocker.CanChangeDirection(human.Uid)); Assert.False(standingState.Down(human.Uid)); Assert.That((human.Transform.WorldPosition - chair.Transform.WorldPosition).Length, Is.LessThanOrEqualTo(buckle.BuckleOffset.Length)); @@ -135,7 +135,7 @@ namespace Content.IntegrationTests.Tests.Buckle Assert.Null(buckle.BuckledTo); Assert.False(buckle.Buckled); Assert.True(actionBlocker.CanMove(human.Uid)); - Assert.True(actionBlocker.CanChangeDirection(human)); + Assert.True(actionBlocker.CanChangeDirection(human.Uid)); Assert.True(standingState.Down(human.Uid)); // Unbuckle, strap @@ -193,7 +193,7 @@ namespace Content.IntegrationTests.Tests.Buckle Assert.True(buckle.TryUnbuckle(human, true)); Assert.False(buckle.Buckled); Assert.True(actionBlocker.CanMove(human.Uid)); - Assert.True(actionBlocker.CanChangeDirection(human)); + Assert.True(actionBlocker.CanChangeDirection(human.Uid)); Assert.True(standingState.Down(human.Uid)); // Re-buckle diff --git a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs index 30b8c10f7b..187142010f 100644 --- a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs +++ b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs @@ -115,18 +115,12 @@ namespace Content.Shared.ActionBlocker return !ev.Cancelled; } - public bool CanChangeDirection(IEntity entity) - { - var ev = new ChangeDirectionAttemptEvent(entity); - - RaiseLocalEvent(entity.Uid, ev); - - return !ev.Cancelled; - } - public bool CanChangeDirection(EntityUid uid) { - return CanChangeDirection(EntityManager.GetEntity(uid)); + var ev = new ChangeDirectionAttemptEvent(uid); + RaiseLocalEvent(uid, ev); + + return !ev.Cancelled; } public bool CanShiver(IEntity entity) diff --git a/Content.Shared/Interaction/Events/ChangeDirectionAttemptEvent.cs b/Content.Shared/Interaction/Events/ChangeDirectionAttemptEvent.cs index 0570cd7daf..1c3e2b35d1 100644 --- a/Content.Shared/Interaction/Events/ChangeDirectionAttemptEvent.cs +++ b/Content.Shared/Interaction/Events/ChangeDirectionAttemptEvent.cs @@ -4,11 +4,11 @@ namespace Content.Shared.Interaction.Events { public class ChangeDirectionAttemptEvent : CancellableEntityEventArgs { - public ChangeDirectionAttemptEvent(IEntity entity) + public ChangeDirectionAttemptEvent(EntityUid uid) { - Entity = entity; + Uid = uid; } - public IEntity Entity { get; } + public EntityUid Uid { get; } } } diff --git a/Content.Shared/Interaction/RotateToFaceSystem.cs b/Content.Shared/Interaction/RotateToFaceSystem.cs index a430cffddf..4a90785c96 100644 --- a/Content.Shared/Interaction/RotateToFaceSystem.cs +++ b/Content.Shared/Interaction/RotateToFaceSystem.cs @@ -45,7 +45,7 @@ namespace Content.Shared.Interaction public bool TryFaceAngle(IEntity user, Angle diffAngle) { - if (_actionBlockerSystem.CanChangeDirection(user)) + if (_actionBlockerSystem.CanChangeDirection(user.Uid)) { user.Transform.WorldRotation = diffAngle; return true;