Deprecate IActionBlocker ChangeDirectionAttempt (#4851)
* Deprecate IActionBlocker ChangeDirectionAttempt * Woops
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.MobState.State;
|
||||
using Content.Shared.Movement;
|
||||
@@ -14,6 +15,7 @@ namespace Content.Shared.MobState.EntitySystems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<MobStateComponent, ChangeDirectionAttemptEvent>(OnChangeDirectionAttempt);
|
||||
SubscribeLocalEvent<MobStateComponent, StartPullAttemptEvent>(OnStartPullAttempt);
|
||||
SubscribeLocalEvent<MobStateComponent, DamageChangedEvent>(UpdateState);
|
||||
SubscribeLocalEvent<MobStateComponent, MovementAttemptEvent>(OnMoveAttempt);
|
||||
@@ -21,6 +23,17 @@ namespace Content.Shared.MobState.EntitySystems
|
||||
// Note that there's no check for Down attempts because if a mob's in crit or dead, they can be downed...
|
||||
}
|
||||
|
||||
private void OnChangeDirectionAttempt(EntityUid uid, MobStateComponent component, ChangeDirectionAttemptEvent args)
|
||||
{
|
||||
switch (component.CurrentState)
|
||||
{
|
||||
case SharedDeadMobState:
|
||||
case SharedCriticalMobState:
|
||||
args.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStartPullAttempt(EntityUid uid, MobStateComponent component, StartPullAttemptEvent args)
|
||||
{
|
||||
if(component.IsIncapacitated())
|
||||
|
||||
Reference in New Issue
Block a user