Remove IActionBlocker.CanMove (#4449)
* Remove IActionBlocker.CanMove Ported the remainders over to using MovementAttemptEvent which should also help make mob movement a bit faster. * Make that check faster
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Movement;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -6,6 +7,18 @@ namespace Content.Shared.Stunnable
|
||||
[UsedImplicitly]
|
||||
internal sealed class StunSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<SharedStunnableComponent, MovementAttemptEvent>(HandleMoveAttempt);
|
||||
}
|
||||
|
||||
private void HandleMoveAttempt(EntityUid uid, SharedStunnableComponent component, MovementAttemptEvent args)
|
||||
{
|
||||
if (component.Stunned)
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
Reference in New Issue
Block a user