diff --git a/Content.Server/Buckle/Systems/StrapSystem.cs b/Content.Server/Buckle/Systems/StrapSystem.cs index c1d8ebe784..660bae255f 100644 --- a/Content.Server/Buckle/Systems/StrapSystem.cs +++ b/Content.Server/Buckle/Systems/StrapSystem.cs @@ -1,8 +1,12 @@ using Content.Server.Buckle.Components; using Content.Server.Interaction; +using Content.Shared.Body.Components; +using Content.Shared.MobState.Components; +using Content.Shared.Storage; using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Server.GameObjects; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; @@ -19,6 +23,14 @@ namespace Content.Server.Buckle.Systems base.Initialize(); SubscribeLocalEvent(AddStrapVerbs); + SubscribeLocalEvent(OnInsertAttempt); + } + + private void OnInsertAttempt(EntityUid uid, StrapComponent component, ContainerGettingInsertedAttemptEvent args) + { + // If someone is attempting to put this item inside of a backpack, ensure that it has no entities strapped to it. + if (HasComp(args.Container.Owner) && component.BuckledEntities.Count != 0) + args.Cancel(); } // TODO ECS BUCKLE/STRAP These 'Strap' verbs are an incestuous mess of buckle component and strap component diff --git a/Content.Server/Foldable/FoldableSystem.cs b/Content.Server/Foldable/FoldableSystem.cs index 37020281f9..9b49a9e54a 100644 --- a/Content.Server/Foldable/FoldableSystem.cs +++ b/Content.Server/Foldable/FoldableSystem.cs @@ -40,7 +40,7 @@ namespace Content.Server.Foldable if (!Resolve(uid, ref fold)) return false; - // Can't un-fold in hands / inventory + // Can't un-fold in any container (locker, hands, inventory, whatever). if (_container.IsEntityInContainer(uid)) return false; diff --git a/Content.Server/Storage/EntitySystems/StorageSystem.cs b/Content.Server/Storage/EntitySystems/StorageSystem.cs index e3b4a473e0..706431c98a 100644 --- a/Content.Server/Storage/EntitySystems/StorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/StorageSystem.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using Content.Server.Hands.Components; -using Content.Server.Interaction; using Content.Server.Storage.Components; using Content.Shared.Interaction; using Content.Shared.Movement; diff --git a/Content.Shared/Foldable/FoldableComponent.cs b/Content.Shared/Foldable/FoldableComponent.cs index 3d861d42b0..70ff400913 100644 --- a/Content.Shared/Foldable/FoldableComponent.cs +++ b/Content.Shared/Foldable/FoldableComponent.cs @@ -9,8 +9,11 @@ using System; namespace Content.Shared.Foldable; /// -/// Used to create "foldable structures" that you can pickup like an item when folded. Used for rollerbeds and wheelchairs +/// Used to create "foldable structures" that you can pickup like an item when folded. Used for rollerbeds and wheelchairs. /// +/// +/// Wiill prevent any insertions into containers while this item is unfolded. +/// [RegisterComponent] [NetworkedComponent] [Friend(typeof(SharedFoldableSystem))] diff --git a/Content.Shared/Foldable/SharedFoldableSystem.cs b/Content.Shared/Foldable/SharedFoldableSystem.cs index de5a9e75ba..fa96d32a5d 100644 --- a/Content.Shared/Foldable/SharedFoldableSystem.cs +++ b/Content.Shared/Foldable/SharedFoldableSystem.cs @@ -1,5 +1,6 @@ using Content.Shared.Item; using JetBrains.Annotations; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.GameStates; @@ -18,7 +19,7 @@ public abstract class SharedFoldableSystem : EntitySystem SubscribeLocalEvent(OnHandleState); SubscribeLocalEvent(OnFoldableInit); - SubscribeLocalEvent(OnPickedUpAttempt); + SubscribeLocalEvent(OnInsertEvent); } private void OnGetState(EntityUid uid, FoldableComponent component, ref ComponentGetState args) @@ -54,7 +55,7 @@ public abstract class SharedFoldableSystem : EntitySystem appearance.SetData(FoldKey, folded); } - private void OnPickedUpAttempt(EntityUid uid, FoldableComponent component, AttemptItemPickupEvent args) + private void OnInsertEvent(EntityUid uid, FoldableComponent component, ContainerGettingInsertedAttemptEvent args) { if (!component.IsFolded) args.Cancel();