]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix foldable clothes not working while worn (#39257)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Mon, 28 Jul 2025 10:19:17 +0000 (06:19 -0400)
committerGitHub <noreply@github.com>
Mon, 28 Jul 2025 10:19:17 +0000 (12:19 +0200)
Content.Shared/Clothing/Components/FoldableClothingComponent.cs
Content.Shared/Clothing/EntitySystems/FoldableClothingSystem.cs

index 7b03adcc8d6b493726fe227520cd03b8c0cf4026..2068162e4928e0063b8e5f6177ad552258561509 100644 (file)
@@ -35,11 +35,11 @@ public sealed partial class FoldableClothingComponent : Component
     /// Which layers does this hide when Unfolded? See <see cref="HumanoidVisualLayers"/> and <see cref="HideLayerClothingComponent"/>
     /// </summary>
     [DataField]
-    public HashSet<HumanoidVisualLayers>? UnfoldedHideLayers = new();
+    public HashSet<HumanoidVisualLayers> UnfoldedHideLayers = new();
 
     /// <summary>
     /// Which layers does this hide when folded? See <see cref="HumanoidVisualLayers"/> and <see cref="HideLayerClothingComponent"/>
     /// </summary>
     [DataField]
-    public HashSet<HumanoidVisualLayers>? FoldedHideLayers = new();
+    public HashSet<HumanoidVisualLayers> FoldedHideLayers = new();
 }
index a60caa454b1e6bb3d5bfbd515e6f5f6ac34e96c7..7c6810140cc3698fc6e5a50e75bc2f6ebd016433 100644 (file)
@@ -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<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
+            if (ent.Comp.FoldedHideLayers.Count != 0 && TryComp<HideLayerClothingComponent>(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<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
+            if (ent.Comp.UnfoldedHideLayers.Count != 0 && TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
                 hideLayerComp.Slots = ent.Comp.UnfoldedHideLayers;
 
         }