]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix borgs not being able to toggle flashlight (#20448)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Wed, 4 Oct 2023 14:30:11 +0000 (10:30 -0400)
committerGitHub <noreply@github.com>
Wed, 4 Oct 2023 14:30:11 +0000 (10:30 -0400)
Content.Server/Light/EntitySystems/HandheldLightSystem.cs
Content.Shared/Light/Components/HandheldLightComponent.cs

index ab3a64a5f072740ec33b9e6e341f98be2ca15b4d..ff3c61bc6110cba2290813d45c1c347299dfe6e8 100644 (file)
@@ -99,11 +99,13 @@ namespace Content.Server.Light.EntitySystems
         private void OnMapInit(EntityUid uid, HandheldLightComponent component, MapInitEvent args)
         {
             _actionContainer.EnsureAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
+            _actions.AddAction(uid, ref component.SelfToggleActionEntity, component.ToggleAction);
         }
 
         private void OnShutdown(EntityUid uid, HandheldLightComponent component, ComponentShutdown args)
         {
             _actions.RemoveAction(uid, component.ToggleActionEntity);
+            _actions.RemoveAction(uid, component.SelfToggleActionEntity);
         }
 
         private byte? GetLevel(EntityUid uid, HandheldLightComponent component)
index 9e3cad7552ca3ab023dd9e61daf9820d38b25585..6c70a82f93a039eee8ee531d5fc5c148bf7e911b 100644 (file)
@@ -48,6 +48,9 @@ public sealed partial class HandheldLightComponent : Component
     [DataField("toggleActionEntity")]
     public EntityUid? ToggleActionEntity;
 
+    [DataField]
+    public EntityUid? SelfToggleActionEntity;
+
     public const int StatusLevels = 6;
 
     /// <summary>