From: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Date: Fri, 30 May 2025 04:30:26 +0000 (-0700) Subject: [Action Refactor Fix] Action blockers now work on Actions (#37948) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=f6c9ef344ee65f370b84d94f1486cf5bea808446;p=space-station-14.git [Action Refactor Fix] Action blockers now work on Actions (#37948) --- 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)