From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:30:11 +0000 (-0400) Subject: fix borgs not being able to toggle flashlight (#20448) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6131721fe5d5232e61735438931b64013d30e051;p=space-station-14.git fix borgs not being able to toggle flashlight (#20448) --- diff --git a/Content.Server/Light/EntitySystems/HandheldLightSystem.cs b/Content.Server/Light/EntitySystems/HandheldLightSystem.cs index ab3a64a5f0..ff3c61bc61 100644 --- a/Content.Server/Light/EntitySystems/HandheldLightSystem.cs +++ b/Content.Server/Light/EntitySystems/HandheldLightSystem.cs @@ -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) diff --git a/Content.Shared/Light/Components/HandheldLightComponent.cs b/Content.Shared/Light/Components/HandheldLightComponent.cs index 9e3cad7552..6c70a82f93 100644 --- a/Content.Shared/Light/Components/HandheldLightComponent.cs +++ b/Content.Shared/Light/Components/HandheldLightComponent.cs @@ -48,6 +48,9 @@ public sealed partial class HandheldLightComponent : Component [DataField("toggleActionEntity")] public EntityUid? ToggleActionEntity; + [DataField] + public EntityUid? SelfToggleActionEntity; + public const int StatusLevels = 6; ///