]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Clothing equipping doAfter tweak (#41732)
authorRed <96445749+TheShuEd@users.noreply.github.com>
Mon, 8 Dec 2025 11:20:42 +0000 (14:20 +0300)
committerGitHub <noreply@github.com>
Mon, 8 Dec 2025 11:20:42 +0000 (11:20 +0000)
* clothing moving break

* Rename EquipOnMoving to EquipWhileMoving

* Update InventorySystem.Equip.cs

Content.Shared/Clothing/Components/ClothingComponent.cs
Content.Shared/Inventory/InventorySystem.Equip.cs

index 2d576637a607d6f33f148d31333c38c1ac0e0184..b009c55201f0c254c5ed7b067b8ab5de88075c4a 100644 (file)
@@ -87,6 +87,15 @@ public sealed partial class ClothingComponent : Component
     [DataField]
     public TimeSpan UnequipDelay = TimeSpan.Zero;
 
+    /// <summary>
+    /// 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).
+    /// </summary>
+    [DataField]
+    public bool EquipWhileMoving = false;
+
     /// <summary>
     /// 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
     /// <summary>
     ///     A scale applied to all layers.
     /// </summary>
-    /// 
     [DataField]
     public Vector2 Scale = Vector2.One;
 }
index 23f658b50d3e8a5b28ec525aad0dee219834f6fe..f12eb8a210d398d814ff09a0cbe9f40409504eb3 100644 (file)
@@ -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,
             };