From 5c0753b1362728a99c256cbe31fefaefcb7569d9 Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sun, 25 Aug 2024 10:09:51 -0700 Subject: [PATCH] Add a bool to disable buckling on InteractHand (#30001) --- Content.Shared/Buckle/Components/StrapComponent.cs | 6 ++++++ Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs | 2 +- .../Prototypes/Entities/Structures/Furniture/rollerbeds.yml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Buckle/Components/StrapComponent.cs b/Content.Shared/Buckle/Components/StrapComponent.cs index b8186e2b79..101c388a8b 100644 --- a/Content.Shared/Buckle/Components/StrapComponent.cs +++ b/Content.Shared/Buckle/Components/StrapComponent.cs @@ -90,6 +90,12 @@ public sealed partial class StrapComponent : Component /// [DataField] public float BuckleDoafterTime = 2f; + + /// + /// Whether InteractHand will buckle the user to the strap. + /// + [DataField] + public bool BuckleOnInteractHand = true; } public enum StrapPosition diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs b/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs index 381789f32d..7677e800fe 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs @@ -84,7 +84,7 @@ public abstract partial class SharedBuckleSystem if (!TryComp(args.User, out BuckleComponent? buckle)) return; - if (buckle.BuckledTo == null) + if (buckle.BuckledTo == null && component.BuckleOnInteractHand) TryBuckle(args.User, args.User, uid, buckle, popup: true); else if (buckle.BuckledTo == uid) TryUnbuckle(args.User, args.User, buckle, popup: true); diff --git a/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml b/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml index f7b1be8ecd..965c8261cc 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml @@ -55,6 +55,7 @@ rotation: -90 buckleOffset: "0,0.15" unbuckleOffset: "0,0.15" + buckleOnInteractHand: False - type: Appearance - type: GenericVisualizer visuals: -- 2.51.2