diff --git a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs index fa8c1af208..e3110eca35 100644 --- a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs @@ -42,6 +42,7 @@ public sealed class ToggleableClothingSystem : EntitySystem SubscribeLocalEvent(OnInteractHand); SubscribeLocalEvent(OnAttachedUnequip); SubscribeLocalEvent(OnRemoveAttached); + SubscribeLocalEvent(OnAttachedUnequipAttempt); SubscribeLocalEvent>>(GetRelayedVerbs); SubscribeLocalEvent>(OnGetVerbs); @@ -176,6 +177,11 @@ public sealed class ToggleableClothingSystem : EntitySystem QueueDel(component.ClothingUid.Value); } + private void OnAttachedUnequipAttempt(EntityUid uid, AttachedClothingComponent component, BeingUnequippedAttemptEvent args) + { + args.Cancel(); + } + private void OnRemoveAttached(EntityUid uid, AttachedClothingComponent component, ComponentRemove args) { // if the attached component is being removed (maybe entity is being deleted?) we will just remove the @@ -242,7 +248,7 @@ public sealed class ToggleableClothingSystem : EntitySystem var parent = Transform(target).ParentUid; if (component.Container.ContainedEntity == null) - _inventorySystem.TryUnequip(user, parent, component.Slot); + _inventorySystem.TryUnequip(user, parent, component.Slot, force: true); else if (_inventorySystem.TryGetSlotEntity(parent, component.Slot, out var existing)) { _popupSystem.PopupClient(Loc.GetString("toggleable-clothing-remove-first", ("entity", existing)),