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

@@ -25,16 +25,6 @@ namespace Content.Shared.ActionBlocker
var ev = new MovementAttemptEvent(entity);
RaiseLocalEvent(entity.Uid, ev);
foreach (var blocker in entity.GetAllComponents<IActionBlocker>())
{
if (!blocker.CanMove())
{
ev.Cancel();
break;
}
}
return !ev.Cancelled;
}

View File

@@ -10,9 +10,6 @@ namespace Content.Shared.ActionBlocker
[Obsolete("Use events instead")]
public interface IActionBlocker
{
[Obsolete("Use MoveAttemptEvent instead")]
bool CanMove() => true;
[Obsolete("Use InteractAttemptEvent instead")]
bool CanInteract() => true;