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:
metalgearsloth
2021-08-10 10:34:01 +10:00
committed by GitHub
parent 0f5f9a7f38
commit b2322864e9
19 changed files with 80 additions and 54 deletions

View File

@@ -0,0 +1,20 @@
using Content.Shared.Movement;
using Robust.Shared.GameObjects;
namespace Content.Shared.Climbing
{
public abstract class SharedClimbSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedClimbingComponent, MovementAttemptEvent>(HandleMoveAttempt);
}
private void HandleMoveAttempt(EntityUid uid, SharedClimbingComponent component, MovementAttemptEvent args)
{
if (component.OwnerIsTransitioning)
args.Cancel();
}
}
}

View File

@@ -29,10 +29,8 @@ namespace Content.Shared.Climbing
}
}
bool IActionBlocker.CanMove() => !OwnerIsTransitioning;
[ViewVariables]
protected virtual bool OwnerIsTransitioning
public virtual bool OwnerIsTransitioning
{
get => _ownerIsTransitioning;
set