]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[Action Refactor Fix] Action blockers now work on Actions (#37948)
authorPrincess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Fri, 30 May 2025 04:30:26 +0000 (21:30 -0700)
committerGitHub <noreply@github.com>
Fri, 30 May 2025 04:30:26 +0000 (00:30 -0400)
Content.Shared/Actions/SharedActionsSystem.cs

index 2a7bc39b907373e08d374ba146c5c0d0f16f7536..d32bd23da0e5b9281adadc131d092d772f4e4cfa 100644 (file)
@@ -58,6 +58,7 @@ public abstract class SharedActionsSystem : EntitySystem
         SubscribeLocalEvent<ActionsComponent, ComponentShutdown>(OnShutdown);
         SubscribeLocalEvent<ActionsComponent, ComponentGetState>(OnGetState);
 
+        SubscribeLocalEvent<ActionComponent, ActionValidateEvent>(OnValidate);
         SubscribeLocalEvent<InstantActionComponent, ActionValidateEvent>(OnInstantValidate);
         SubscribeLocalEvent<EntityTargetActionComponent, ActionValidateEvent>(OnEntityValidate);
         SubscribeLocalEvent<WorldTargetActionComponent, ActionValidateEvent>(OnWorldValidate);
@@ -316,19 +317,9 @@ public abstract class SharedActionsSystem : EntitySystem
 
     private void OnValidate(Entity<ActionComponent> 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<InstantActionComponent> ent, ref ActionValidateEvent args)