From f6c9ef344ee65f370b84d94f1486cf5bea808446 Mon Sep 17 00:00:00 2001 From: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Date: Thu, 29 May 2025 21:30:26 -0700 Subject: [PATCH] [Action Refactor Fix] Action blockers now work on Actions (#37948) --- Content.Shared/Actions/SharedActionsSystem.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index 2a7bc39b90..d32bd23da0 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -58,6 +58,7 @@ public abstract class SharedActionsSystem : EntitySystem SubscribeLocalEvent(OnShutdown); SubscribeLocalEvent(OnGetState); + SubscribeLocalEvent(OnValidate); SubscribeLocalEvent(OnInstantValidate); SubscribeLocalEvent(OnEntityValidate); SubscribeLocalEvent(OnWorldValidate); @@ -316,19 +317,9 @@ public abstract class SharedActionsSystem : EntitySystem private void OnValidate(Entity ent, ref ActionValidateEvent args) { - if (ent.Comp.CheckConsciousness && !_actionBlocker.CanConsciouslyPerformAction(args.User)) - { + if ((ent.Comp.CheckConsciousness && !_actionBlocker.CanConsciouslyPerformAction(args.User)) + || (ent.Comp.CheckCanInteract && !_actionBlocker.CanInteract(args.User, null))) args.Invalid = true; - return; - } - - if (ent.Comp.CheckCanInteract && !_actionBlocker.CanInteract(args.User, null)) - { - args.Invalid = true; - return; - } - - // Event is not set here, only below } private void OnInstantValidate(Entity ent, ref ActionValidateEvent args)