]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix suit baldness (#27404)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Sat, 27 Apr 2024 19:10:47 +0000 (21:10 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2024 19:10:47 +0000 (13:10 -0600)
Initial commit

Content.Shared/Clothing/EntitySystems/ClothingSystem.cs

index d85506df4b1469ad1f8a9e0d6727d467e67970fc..e8bfb789613e1dc732ce74ac1ae082bb4f552ce8 100644 (file)
@@ -96,20 +96,23 @@ public abstract class ClothingSystem : EntitySystem
             {
                 if (TryComp(item, out HideLayerClothingComponent? comp))
                 {
-                    //Checks for mask toggling. TODO: Make a generic system for this
-                    if (comp.HideOnToggle && TryComp(item, out MaskComponent? mask) && TryComp(item, out ClothingComponent? clothing))
+                    if (comp.Slots.Contains(layer))
                     {
-                        if (clothing.EquippedPrefix != mask.EquippedPrefix)
+                        //Checks for mask toggling. TODO: Make a generic system for this
+                        if (comp.HideOnToggle && TryComp(item, out MaskComponent? mask) && TryComp(item, out ClothingComponent? clothing))
+                        {
+                            if (clothing.EquippedPrefix != mask.EquippedPrefix)
+                            {
+                                shouldLayerShow = false;
+                                break;
+                            }
+                        }
+                        else
                         {
                             shouldLayerShow = false;
                             break;
                         }
                     }
-                    else
-                    {
-                        shouldLayerShow = false;
-                        break;
-                    }
                 }
             }
             _humanoidSystem.SetLayerVisibility(equipee, layer, shouldLayerShow);