From: Red <96445749+TheShuEd@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:20:42 +0000 (+0300) Subject: Clothing equipping doAfter tweak (#41732) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9c2dc0451940fe4518ceff693eceafb2278fd245;p=space-station-14.git Clothing equipping doAfter tweak (#41732) * clothing moving break * Rename EquipOnMoving to EquipWhileMoving * Update InventorySystem.Equip.cs --- diff --git a/Content.Shared/Clothing/Components/ClothingComponent.cs b/Content.Shared/Clothing/Components/ClothingComponent.cs index 2d576637a6..b009c55201 100644 --- a/Content.Shared/Clothing/Components/ClothingComponent.cs +++ b/Content.Shared/Clothing/Components/ClothingComponent.cs @@ -87,6 +87,15 @@ public sealed partial class ClothingComponent : Component [DataField] public TimeSpan UnequipDelay = TimeSpan.Zero; + /// + /// Only works when EquipDelay or UnequipDelay > 0. + /// Prevents clothing from being put on or taken off while moving. + /// Some clothing can logically be put on while running (hats), + /// while other types of clothing may require stopping (shoes, hard suits). + /// + [DataField] + public bool EquipWhileMoving = false; + /// /// Offset for the strip time for an entity with this component. /// Only applied when it is being equipped or removed by another player. @@ -97,7 +106,6 @@ public sealed partial class ClothingComponent : Component /// /// A scale applied to all layers. /// - /// [DataField] public Vector2 Scale = Vector2.One; } diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index 23f658b50d..f12eb8a210 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -168,7 +168,7 @@ public abstract partial class InventorySystem target, itemUid) { - BreakOnMove = true, + BreakOnMove = !clothing.EquipWhileMoving, NeedHand = true, }; @@ -439,7 +439,7 @@ public abstract partial class InventorySystem target, removedItem.Value) { - BreakOnMove = true, + BreakOnMove = !clothing.EquipWhileMoving, NeedHand = true, };