Clothing equipping doAfter tweak (#41732)

* clothing moving break

* Rename EquipOnMoving to EquipWhileMoving

* Update InventorySystem.Equip.cs
This commit is contained in:
Red
2025-12-08 14:20:42 +03:00
committed by GitHub
parent 0031beca4b
commit 9c2dc04519
2 changed files with 11 additions and 3 deletions

View 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;
}

View 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,
};