From 9c2dc0451940fe4518ceff693eceafb2278fd245 Mon Sep 17 00:00:00 2001
From: Red <96445749+TheShuEd@users.noreply.github.com>
Date: Mon, 8 Dec 2025 14:20:42 +0300
Subject: [PATCH] Clothing equipping doAfter tweak (#41732)
* clothing moving break
* Rename EquipOnMoving to EquipWhileMoving
* Update InventorySystem.Equip.cs
---
.../Clothing/Components/ClothingComponent.cs | 10 +++++++++-
Content.Shared/Inventory/InventorySystem.Equip.cs | 4 ++--
2 files changed, 11 insertions(+), 3 deletions(-)
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,
};
--
2.52.0