From 78939b4c045364638fbd32bd875c2d8f39bd490f Mon Sep 17 00:00:00 2001 From: brainfood1183 <113240905+brainfood1183@users.noreply.github.com> Date: Thu, 15 Jun 2023 04:02:33 +0100 Subject: [PATCH] Crazy Glue Fix (#17262) --- Content.Server/Glue/GlueSystem.cs | 2 -- Content.Server/Glue/GluedSystem.cs | 16 ++++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Content.Server/Glue/GlueSystem.cs b/Content.Server/Glue/GlueSystem.cs index 91dc122daf..fbd2800704 100644 --- a/Content.Server/Glue/GlueSystem.cs +++ b/Content.Server/Glue/GlueSystem.cs @@ -39,11 +39,9 @@ namespace Content.Server.Glue return; } - if (HasComp(target)) { _audio.PlayPvs(component.Squeeze, uid); - EnsureComp(target); _popup.PopupEntity(Loc.GetString("glue-success", ("target", Identity.Entity(target, EntityManager))), args.User, args.User, PopupType.Medium); EnsureComp(target); diff --git a/Content.Server/Glue/GluedSystem.cs b/Content.Server/Glue/GluedSystem.cs index ea0ceff438..6a7516cd79 100644 --- a/Content.Server/Glue/GluedSystem.cs +++ b/Content.Server/Glue/GluedSystem.cs @@ -1,8 +1,7 @@ using Content.Shared.Interaction.Components; using Robust.Shared.Timing; -using Content.Shared.Interaction; using Content.Shared.Glue; -using Content.Shared.Hands.Components; +using Content.Shared.Hands; namespace Content.Server.Glue; @@ -16,7 +15,7 @@ public sealed class GluedSystem : EntitySystem base.Initialize(); SubscribeLocalEvent(OnGluedInit); - SubscribeLocalEvent(OnPickUp); + SubscribeLocalEvent(OnHandPickUp); } // Timing to remove glued and unremoveable. @@ -52,13 +51,10 @@ public sealed class GluedSystem : EntitySystem } // Timers start only when the glued item is picked up. - private void OnPickUp(EntityUid uid, GluedComponent component, InteractHandEvent args) + private void OnHandPickUp(EntityUid uid, GluedComponent component, GotEquippedHandEvent args) { - var userHands = Comp(args.User); - if (userHands.ActiveHandEntity == uid) - { - component.GlueBroken = true; - component.GlueTime = _timing.CurTime + component.GlueCooldown; - } + EnsureComp(uid); + component.GlueBroken = true; + component.GlueTime = _timing.CurTime + component.GlueCooldown; } }