From fedc355f20539e4bc955c58bac754b1043522c61 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Mon, 28 Jul 2025 06:19:17 -0400 Subject: [PATCH] fix foldable clothes not working while worn (#39257) --- .../Clothing/Components/FoldableClothingComponent.cs | 4 ++-- .../Clothing/EntitySystems/FoldableClothingSystem.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Content.Shared/Clothing/Components/FoldableClothingComponent.cs b/Content.Shared/Clothing/Components/FoldableClothingComponent.cs index 7b03adcc8d..2068162e49 100644 --- a/Content.Shared/Clothing/Components/FoldableClothingComponent.cs +++ b/Content.Shared/Clothing/Components/FoldableClothingComponent.cs @@ -35,11 +35,11 @@ public sealed partial class FoldableClothingComponent : Component /// Which layers does this hide when Unfolded? See and /// [DataField] - public HashSet? UnfoldedHideLayers = new(); + public HashSet UnfoldedHideLayers = new(); /// /// Which layers does this hide when folded? See and /// [DataField] - public HashSet? FoldedHideLayers = new(); + public HashSet FoldedHideLayers = new(); } diff --git a/Content.Shared/Clothing/EntitySystems/FoldableClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/FoldableClothingSystem.cs index a60caa454b..7c6810140c 100644 --- a/Content.Shared/Clothing/EntitySystems/FoldableClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/FoldableClothingSystem.cs @@ -37,7 +37,7 @@ public sealed class FoldableClothingSystem : EntitySystem } // Setting hidden layers while equipped is not currently supported. - if (ent.Comp.FoldedHideLayers != null || ent.Comp.UnfoldedHideLayers != null) + if (ent.Comp.FoldedHideLayers.Count != 0|| ent.Comp.UnfoldedHideLayers.Count != 0) args.Cancelled = true; } @@ -65,7 +65,7 @@ public sealed class FoldableClothingSystem : EntitySystem // This should instead work via an event or something that gets raised to optionally modify the currently hidden layers. // Or at the very least it should stash the old layers and restore them when unfolded. // TODO CLOTHING fix this. - if (ent.Comp.FoldedHideLayers != null && TryComp(ent.Owner, out var hideLayerComp)) + if (ent.Comp.FoldedHideLayers.Count != 0 && TryComp(ent.Owner, out var hideLayerComp)) hideLayerComp.Slots = ent.Comp.FoldedHideLayers; } @@ -81,7 +81,7 @@ public sealed class FoldableClothingSystem : EntitySystem _itemSystem.SetHeldPrefix(ent.Owner, null, false, itemComp); // TODO CLOTHING fix this. - if (ent.Comp.UnfoldedHideLayers != null && TryComp(ent.Owner, out var hideLayerComp)) + if (ent.Comp.UnfoldedHideLayers.Count != 0 && TryComp(ent.Owner, out var hideLayerComp)) hideLayerComp.Slots = ent.Comp.UnfoldedHideLayers; } -- 2.51.2