fix borgs not being able to toggle flashlight (#20448)
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user