From 2dfdf73aa6fd1de8d75a29b0b61b408168a092b1 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 27 Mar 2023 00:15:32 +1100 Subject: [PATCH] Fix cuff layer spam (#14869) --- Content.Client/Cuffs/CuffableSystem.cs | 17 +++++++++-------- Content.Shared/Cuffs/SharedCuffableSystem.cs | 6 ++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Content.Client/Cuffs/CuffableSystem.cs b/Content.Client/Cuffs/CuffableSystem.cs index 1109d3785f..76d9ce1639 100644 --- a/Content.Client/Cuffs/CuffableSystem.cs +++ b/Content.Client/Cuffs/CuffableSystem.cs @@ -15,17 +15,11 @@ public sealed class CuffableSystem : SharedCuffableSystem { base.Initialize(); - SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnCuffableShutdown); SubscribeLocalEvent(OnCuffableHandleState); SubscribeLocalEvent(OnHandcuffHandleState); } - private void OnShutdown(EntityUid uid, CuffableComponent component, ComponentShutdown args) - { - if (TryComp(uid, out var sprite)) - sprite.LayerSetVisible(HumanoidVisualLayers.Handcuffs, false); - } - private void OnHandcuffHandleState(EntityUid uid, HandcuffComponent component, ref ComponentHandleState args) { if (args.Current is not HandcuffComponentState state) @@ -38,10 +32,17 @@ public sealed class CuffableSystem : SharedCuffableSystem if (TryComp(uid, out var sprite)) { - sprite.LayerSetState(HumanoidVisualLayers.Handcuffs, state.IconState); + // If you think this should be an explicit layer look at the YML and see https://github.com/space-wizards/space-station-14/issues/14771 + sprite.LayerSetState(0, state.IconState); } } + private void OnCuffableShutdown(EntityUid uid, CuffableComponent component, ComponentShutdown args) + { + if (TryComp(uid, out var sprite)) + sprite.LayerSetVisible(HumanoidVisualLayers.Handcuffs, false); + } + private void OnCuffableHandleState(EntityUid uid, CuffableComponent component, ref ComponentHandleState args) { if (args.Current is not CuffableComponentState cuffState) diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index da67a118e3..2cf87ea96c 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -28,18 +28,16 @@ using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Containers; using Robust.Shared.Network; using Robust.Shared.Player; -using Robust.Shared.Timing; namespace Content.Shared.Cuffs { public abstract class SharedCuffableSystem : EntitySystem { - [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; - [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly INetManager _net = default!; [Dependency] private readonly ISharedAdminLogManager _adminLog = default!; + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; + [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedContainerSystem _container = default!; -- 2.51.2