fix borgs not being able to toggle flashlight (#20448)

This commit is contained in:
Nemanja
2023-10-04 10:30:11 -04:00
committed by GitHub
parent bfa301b53e
commit 6131721fe5
2 changed files with 5 additions and 0 deletions

View File

@@ -99,11 +99,13 @@ namespace Content.Server.Light.EntitySystems
private void OnMapInit(EntityUid uid, HandheldLightComponent component, MapInitEvent args) private void OnMapInit(EntityUid uid, HandheldLightComponent component, MapInitEvent args)
{ {
_actionContainer.EnsureAction(uid, ref component.ToggleActionEntity, component.ToggleAction); _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) private void OnShutdown(EntityUid uid, HandheldLightComponent component, ComponentShutdown args)
{ {
_actions.RemoveAction(uid, component.ToggleActionEntity); _actions.RemoveAction(uid, component.ToggleActionEntity);
_actions.RemoveAction(uid, component.SelfToggleActionEntity);
} }
private byte? GetLevel(EntityUid uid, HandheldLightComponent component) private byte? GetLevel(EntityUid uid, HandheldLightComponent component)

View File

@@ -48,6 +48,9 @@ public sealed partial class HandheldLightComponent : Component
[DataField("toggleActionEntity")] [DataField("toggleActionEntity")]
public EntityUid? ToggleActionEntity; public EntityUid? ToggleActionEntity;
[DataField]
public EntityUid? SelfToggleActionEntity;
public const int StatusLevels = 6; public const int StatusLevels = 6;
/// <summary> /// <summary>