]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix visual bug with masks appearing to be pulled down after re-equipping (#40332)
authorWinkarst-cpu <74284083+Winkarst-cpu@users.noreply.github.com>
Sat, 11 Oct 2025 22:21:04 +0000 (01:21 +0300)
committerGitHub <noreply@github.com>
Sat, 11 Oct 2025 22:21:04 +0000 (22:21 +0000)
Fix

Content.Shared/Clothing/EntitySystems/MaskSystem.cs

index 30e00faf0ac1a0acbd576c5b1313526ccf96365b..0c53349934b566d0bcec3fe5048c5c8eaef29d03 100644 (file)
@@ -62,27 +62,7 @@ public sealed class MaskSystem : EntitySystem
 
     private void OnGotUnequipped(EntityUid uid, MaskComponent mask, GotUnequippedEvent args)
     {
-        if (!mask.IsToggled || !mask.IsToggleable)
-            return;
-
-        mask.IsToggled = false;
-        ToggleMaskComponents(uid, mask, args.Equipee, mask.EquippedPrefix, true);
-    }
-
-    /// <summary>
-    /// Called after setting IsToggled, raises events and dirties.
-    /// </summary>
-    private void ToggleMaskComponents(EntityUid uid, MaskComponent mask, EntityUid wearer, string? equippedPrefix = null, bool isEquip = false)
-    {
-        Dirty(uid, mask);
-        if (mask.ToggleActionEntity is { } action)
-            _actionSystem.SetToggled(action, mask.IsToggled);
-
-        var maskEv = new ItemMaskToggledEvent((uid, mask), wearer);
-        RaiseLocalEvent(uid, ref maskEv);
-
-        var wearerEv = new WearerMaskToggledEvent((uid, mask));
-        RaiseLocalEvent(wearer, ref wearerEv);
+        SetToggled(uid, false);
     }
 
     private void OnFolded(Entity<MaskComponent> ent, ref FoldedEvent args)