diff --git a/Content.Shared/Foldable/FoldableSystem.cs b/Content.Shared/Foldable/FoldableSystem.cs index 7bf00a5d24..6f2e9f3ee5 100644 --- a/Content.Shared/Foldable/FoldableSystem.cs +++ b/Content.Shared/Foldable/FoldableSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Buckle; +using Content.Shared.Buckle.Components; using Content.Shared.Storage.Components; using Content.Shared.Verbs; using Robust.Shared.Containers; @@ -26,6 +27,8 @@ public sealed class FoldableSystem : EntitySystem SubscribeLocalEvent(OnInsertEvent); SubscribeLocalEvent(OnStoreThisAttempt); SubscribeLocalEvent(OnFoldableOpenAttempt); + + SubscribeLocalEvent(OnBuckleAttempt); } private void OnGetState(EntityUid uid, FoldableComponent component, ref ComponentGetState args) @@ -61,6 +64,12 @@ public sealed class FoldableSystem : EntitySystem args.Cancelled = true; } + public void OnBuckleAttempt(EntityUid uid, FoldableComponent comp, ref BuckleAttemptEvent args) + { + if (args.Buckling && comp.IsFolded) + args.Cancelled = true; + } + /// /// Returns false if the entity isn't foldable. ///