From 9366ca374ad21c67973c347c7977d6764f14234a Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Fri, 10 Jan 2025 03:52:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=B3=D0=B8=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=B3=D1=83=D1=82=20=D0=BE=D0=BF=D1=8F=D1=82=D1=8C=20=D1=81?= =?UTF-8?q?=D0=B0=D0=B4=D0=B8=D1=82=D1=8C=20=D0=BD=D0=B0=20=D1=81=D0=B5?= =?UTF-8?q?=D0=B1=D1=8F=20=D0=BB=D1=8E=D0=B4=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Shared/Strip/Components/StrippingComponent.cs | 2 ++ Content.Shared/Strip/SharedStrippableSystem.cs | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Strip/Components/StrippingComponent.cs b/Content.Shared/Strip/Components/StrippingComponent.cs index bcf766e2b20..4955d187879 100644 --- a/Content.Shared/Strip/Components/StrippingComponent.cs +++ b/Content.Shared/Strip/Components/StrippingComponent.cs @@ -8,7 +8,9 @@ namespace Content.Shared.Strip.Components [RegisterComponent, NetworkedComponent] public sealed partial class StrippingComponent : Component { + // Sunrise-Start [DataField] public bool UseDragDrop = true; + // Sunrise-End } } diff --git a/Content.Shared/Strip/SharedStrippableSystem.cs b/Content.Shared/Strip/SharedStrippableSystem.cs index 1fc3f6bd065..0610acd78f7 100644 --- a/Content.Shared/Strip/SharedStrippableSystem.cs +++ b/Content.Shared/Strip/SharedStrippableSystem.cs @@ -626,6 +626,13 @@ private void OnDragDrop(EntityUid uid, StrippableComponent component, ref DragDr if (args.Handled || args.Target != args.User) return; + // Sunrise-Start + if (!TryComp(args.Target, out var strippingComp) || !strippingComp.UseDragDrop) + { + return; + } + // Sunrise-End + if (TryOpenStrippingUi(args.User, (uid, component))) args.Handled = true; } @@ -655,8 +662,7 @@ private void OnCanDropOn(EntityUid uid, StrippingComponent component, ref CanDro private void OnCanDrop(EntityUid uid, StrippableComponent component, ref CanDropDraggedEvent args) { args.CanDrop |= args.Target == args.User && - TryComp(args.User, out var strippingComponent) && - strippingComponent.UseDragDrop && + HasComp(args.User) && HasComp(args.User); if (args.CanDrop)