Fix visual bug with masks appearing to be pulled down after re-equipping (#40332)

Fix
This commit is contained in:
Winkarst-cpu
2025-10-12 01:21:04 +03:00
committed by GitHub
parent b1fa06d6b0
commit 0ad48093a2

View 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)