]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix ghost actions not appearing (#15805)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Wed, 26 Apr 2023 04:05:04 +0000 (16:05 +1200)
committerGitHub <noreply@github.com>
Wed, 26 Apr 2023 04:05:04 +0000 (14:05 +1000)
Content.Client/Actions/ActionsSystem.cs

index db484df882934829d59dafd5ff8e1f9f438dfbae..9e594260f3d7610a9085836644712536f4290910 100644 (file)
@@ -129,9 +129,6 @@ namespace Content.Client.Actions
 
         public override void AddAction(EntityUid uid, ActionType action, EntityUid? provider, ActionsComponent? comp = null, bool dirty = true)
         {
-            if (uid != _playerManager.LocalPlayer?.ControlledEntity)
-                return;
-
             if (GameTiming.ApplyingState && !action.ClientExclusive)
                 return;
 
@@ -140,14 +137,13 @@ namespace Content.Client.Actions
 
             dirty &= !action.ClientExclusive;
             base.AddAction(uid, action, provider, comp, dirty);
-            ActionAdded?.Invoke(action);
+
+            if (uid == _playerManager.LocalPlayer?.ControlledEntity)
+                ActionAdded?.Invoke(action);
         }
 
         public override void RemoveAction(EntityUid uid, ActionType action, ActionsComponent? comp = null, bool dirty = true)
         {
-            if (uid != _playerManager.LocalPlayer?.ControlledEntity)
-                return;
-
             if (GameTiming.ApplyingState && !action.ClientExclusive)
                 return;
 
@@ -157,7 +153,7 @@ namespace Content.Client.Actions
             dirty &= !action.ClientExclusive;
             base.RemoveAction(uid, action, comp, dirty);
 
-            if (action.AutoRemove)
+            if (action.AutoRemove && uid == _playerManager.LocalPlayer?.ControlledEntity)
                 ActionRemoved?.Invoke(action);
         }